diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md index d518ea66cb153..caf3e53aad11a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md +++ b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-04-07) +- Azure Resource Manager DataMigration client library for Java. This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-preview-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-14) diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/README.md b/sdk/datamigration/azure-resourcemanager-datamigration/README.md index 901c66b0d0d07..b10a68635b926 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/README.md +++ b/sdk/datamigration/azure-resourcemanager-datamigration/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DataMigration client library for Java. -This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-2018-04-19. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-preview-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-datamigration - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md b/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md new file mode 100644 index 0000000000000..69c35b4751109 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md @@ -0,0 +1,1975 @@ +# Code snippets and samples + + +## DatabaseMigrationsSqlDb + +- [Cancel](#databasemigrationssqldb_cancel) +- [CreateOrUpdate](#databasemigrationssqldb_createorupdate) +- [Delete](#databasemigrationssqldb_delete) +- [Get](#databasemigrationssqldb_get) + +## DatabaseMigrationsSqlMi + +- [Cancel](#databasemigrationssqlmi_cancel) +- [CreateOrUpdate](#databasemigrationssqlmi_createorupdate) +- [Cutover](#databasemigrationssqlmi_cutover) +- [Get](#databasemigrationssqlmi_get) + +## DatabaseMigrationsSqlVm + +- [Cancel](#databasemigrationssqlvm_cancel) +- [CreateOrUpdate](#databasemigrationssqlvm_createorupdate) +- [Cutover](#databasemigrationssqlvm_cutover) +- [Get](#databasemigrationssqlvm_get) + +## Files + +- [CreateOrUpdate](#files_createorupdate) +- [Delete](#files_delete) +- [Get](#files_get) +- [List](#files_list) +- [Read](#files_read) +- [ReadWrite](#files_readwrite) +- [Update](#files_update) + +## Operations + +- [List](#operations_list) + +## Projects + +- [CreateOrUpdate](#projects_createorupdate) +- [Delete](#projects_delete) +- [Get](#projects_get) +- [List](#projects_list) +- [Update](#projects_update) + +## ResourceSkus + +- [List](#resourceskus_list) + +## ServiceTasks + +- [Cancel](#servicetasks_cancel) +- [CreateOrUpdate](#servicetasks_createorupdate) +- [Delete](#servicetasks_delete) +- [Get](#servicetasks_get) +- [List](#servicetasks_list) +- [Update](#servicetasks_update) + +## Services + +- [CheckChildrenNameAvailability](#services_checkchildrennameavailability) +- [CheckNameAvailability](#services_checknameavailability) +- [CheckStatus](#services_checkstatus) +- [CreateOrUpdate](#services_createorupdate) +- [Delete](#services_delete) +- [GetByResourceGroup](#services_getbyresourcegroup) +- [List](#services_list) +- [ListByResourceGroup](#services_listbyresourcegroup) +- [ListSkus](#services_listskus) +- [Start](#services_start) +- [Stop](#services_stop) +- [Update](#services_update) + +## SqlMigrationServices + +- [CreateOrUpdate](#sqlmigrationservices_createorupdate) +- [Delete](#sqlmigrationservices_delete) +- [DeleteNode](#sqlmigrationservices_deletenode) +- [GetByResourceGroup](#sqlmigrationservices_getbyresourcegroup) +- [List](#sqlmigrationservices_list) +- [ListAuthKeys](#sqlmigrationservices_listauthkeys) +- [ListByResourceGroup](#sqlmigrationservices_listbyresourcegroup) +- [ListMigrations](#sqlmigrationservices_listmigrations) +- [ListMonitoringData](#sqlmigrationservices_listmonitoringdata) +- [RegenerateAuthKeys](#sqlmigrationservices_regenerateauthkeys) +- [Update](#sqlmigrationservices_update) + +## Tasks + +- [Cancel](#tasks_cancel) +- [Command](#tasks_command) +- [CreateOrUpdate](#tasks_createorupdate) +- [Delete](#tasks_delete) +- [Get](#tasks_get) +- [List](#tasks_list) +- [Update](#tasks_update) + +## Usages + +- [List](#usages_list) +### DatabaseMigrationsSqlDb_Cancel + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** Samples for DatabaseMigrationsSqlDb Cancel. */ +public final class DatabaseMigrationsSqlDbCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void stopOngoingMigrationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlDbs() + .cancel( + "testrg", + "sqldbinstance", + "db1", + new MigrationOperationInput() + .withMigrationOperationId(UUID.fromString("9a90bb84-e70f-46f7-b0ae-1aef5b3b9f07")), + Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlDb_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import java.util.Arrays; + +/** Samples for DatabaseMigrationsSqlDb CreateOrUpdate. */ +public final class DatabaseMigrationsSqlDbCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties( + new DatabaseMigrationPropertiesSqlDb() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withTargetSqlConnection( + new SqlConnectionInformation() + .withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withTableList(Arrays.asList("[Schema1].[TableName1]", "[Schema2].[TableName2]"))) + .create(); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties( + new DatabaseMigrationPropertiesSqlDb() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withTargetSqlConnection( + new SqlConnectionInformation() + .withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true))) + .create(); + } +} +``` + +### DatabaseMigrationsSqlDb_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DatabaseMigrationsSqlDb Delete. */ +public final class DatabaseMigrationsSqlDbDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteDatabaseMigrationResource( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs().delete("testrg", "sqldbinstance", "db1", null, Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlDb_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DatabaseMigrationsSqlDb Get. */ +public final class DatabaseMigrationsSqlDbGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql DB database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlDBDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs().getWithResponse("testrg", "sqldbinstance", "db1", null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlDbGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql DB database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlDBDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlDbs() + .getWithResponse("testrg", "sqldbinstance", "db1", null, "MigrationStatusDetails", Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlMi_Cancel + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** Samples for DatabaseMigrationsSqlMi Cancel. */ +public final class DatabaseMigrationsSqlMiCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void stopOngoingMigrationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .cancel( + "testrg", + "managedInstance1", + "db1", + new MigrationOperationInput() + .withMigrationOperationId(UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), + Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlMi_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; + +/** Samples for DatabaseMigrationsSqlMi CreateOrUpdate. */ +public final class DatabaseMigrationsSqlMiCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties( + new DatabaseMigrationPropertiesSqlMi() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withBackupConfiguration( + new BackupConfiguration() + .withSourceLocation( + new SourceLocation() + .withFileShare( + new SqlFileShare() + .withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("placeholder"))) + .withTargetLocation( + new TargetLocation() + .withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("abcd"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties( + new DatabaseMigrationPropertiesSqlMi() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withBackupConfiguration( + new BackupConfiguration() + .withSourceLocation( + new SourceLocation() + .withFileShare( + new SqlFileShare() + .withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("placeholder"))) + .withTargetLocation( + new TargetLocation() + .withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("abcd")))) + .create(); + } +} +``` + +### DatabaseMigrationsSqlMi_Cutover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** Samples for DatabaseMigrationsSqlMi Cutover. */ +public final class DatabaseMigrationsSqlMiCutoverSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .cutover( + "testrg", + "managedInstance1", + "db1", + new MigrationOperationInput() + .withMigrationOperationId(UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), + Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlMi_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DatabaseMigrationsSqlMi Get. */ +public final class DatabaseMigrationsSqlMiGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql MI database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, "MigrationStatusDetails", Context.NONE); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlMiGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql MI database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, null, Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlVm_Cancel + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** Samples for DatabaseMigrationsSqlVm Cancel. */ +public final class DatabaseMigrationsSqlVmCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void stopOngoingMigrationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlVms() + .cancel( + "testrg", + "testvm", + "db1", + new MigrationOperationInput() + .withMigrationOperationId(UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), + Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlVm_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; + +/** Samples for DatabaseMigrationsSqlVm CreateOrUpdate. */ +public final class DatabaseMigrationsSqlVmCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties( + new DatabaseMigrationPropertiesSqlVm() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withBackupConfiguration( + new BackupConfiguration() + .withSourceLocation( + new SourceLocation() + .withFileShare( + new SqlFileShare() + .withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("placeholder"))) + .withTargetLocation( + new TargetLocation() + .withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("abcd"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties( + new DatabaseMigrationPropertiesSqlVm() + .withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withSourceSqlConnection( + new SqlConnectionInformation() + .withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("placeholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withBackupConfiguration( + new BackupConfiguration() + .withSourceLocation( + new SourceLocation() + .withFileShare( + new SqlFileShare() + .withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("placeholder"))) + .withTargetLocation( + new TargetLocation() + .withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("abcd")))) + .create(); + } +} +``` + +### DatabaseMigrationsSqlVm_Cutover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** Samples for DatabaseMigrationsSqlVm Cutover. */ +public final class DatabaseMigrationsSqlVmCutoverSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlVms() + .cutover( + "testrg", + "testvm", + "db1", + new MigrationOperationInput() + .withMigrationOperationId(UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), + Context.NONE); + } +} +``` + +### DatabaseMigrationsSqlVm_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DatabaseMigrationsSqlVm Get. */ +public final class DatabaseMigrationsSqlVmGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql VM database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlVMDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .databaseMigrationsSqlVms() + .getWithResponse("testrg", "testvm", "db1", null, "MigrationStatusDetails", Context.NONE); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/SqlVmGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql VM database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlVMDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms().getWithResponse("testrg", "testvm", "db1", null, null, Context.NONE); + } +} +``` + +### Files_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** Samples for Files CreateOrUpdate. */ +public final class FilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_CreateOrUpdate.json + */ + /** + * Sample code: Files_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .files() + .define("x114d023d8") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .create(); + } +} +``` + +### Files_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Files Delete. */ +public final class FilesDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_Delete.json + */ + /** + * Sample code: Files_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", Context.NONE); + } +} +``` + +### Files_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Files Get. */ +public final class FilesGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_Get.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", Context.NONE); + } +} +``` + +### Files_List + +```java +import com.azure.core.util.Context; + +/** Samples for Files List. */ +public final class FilesListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_List.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", Context.NONE); + } +} +``` + +### Files_Read + +```java +import com.azure.core.util.Context; + +/** Samples for Files Read. */ +public final class FilesReadSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_Read.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().readWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", Context.NONE); + } +} +``` + +### Files_ReadWrite + +```java +import com.azure.core.util.Context; + +/** Samples for Files ReadWrite. */ +public final class FilesReadWriteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_ReadWrite.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().readWriteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", Context.NONE); + } +} +``` + +### Files_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** Samples for Files Update. */ +public final class FilesUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Files_Update.json + */ + /** + * Sample code: Files_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + ProjectFile resource = + manager + .files() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", Context.NONE) + .getValue(); + resource + .update() + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .apply(); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ListOperation.json + */ + /** + * Sample code: Lists all of the available SQL Rest API operations. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listsAllOfTheAvailableSQLRestAPIOperations( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Projects_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; + +/** Samples for Projects CreateOrUpdate. */ +public final class ProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Projects_CreateOrUpdate.json + */ + /** + * Sample code: Projects_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .projects() + .define("DmsSdkProject") + .withRegion("southcentralus") + .withExistingService("DmsSdkRg", "DmsSdkService") + .withSourcePlatform(ProjectSourcePlatform.SQL) + .withTargetPlatform(ProjectTargetPlatform.SQLDB) + .create(); + } +} +``` + +### Projects_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Projects Delete. */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Projects_Delete.json + */ + /** + * Sample code: Projects_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects().deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, Context.NONE); + } +} +``` + +### Projects_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Projects Get. */ +public final class ProjectsGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Projects_Get.json + */ + /** + * Sample code: Projects_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", Context.NONE); + } +} +``` + +### Projects_List + +```java +import com.azure.core.util.Context; + +/** Samples for Projects List. */ +public final class ProjectsListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Projects_List.json + */ + /** + * Sample code: Projects_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects().list("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Projects_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.Project; +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; + +/** Samples for Projects Update. */ +public final class ProjectsUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Projects_Update.json + */ + /** + * Sample code: Projects_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + Project resource = + manager.projects().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", Context.NONE).getValue(); + resource + .update() + .withSourcePlatform(ProjectSourcePlatform.SQL) + .withTargetPlatform(ProjectTargetPlatform.SQLDB) + .apply(); + } +} +``` + +### ResourceSkus_List + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceSkus List. */ +public final class ResourceSkusListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ResourceSkus_ListSkus.json + */ + /** + * Sample code: ListSkus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.resourceSkus().list(Context.NONE); + } +} +``` + +### ServiceTasks_Cancel + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTasks Cancel. */ +public final class ServiceTasksCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", Context.NONE); + } +} +``` + +### ServiceTasks_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CheckOciDriverTaskInput; +import com.azure.resourcemanager.datamigration.models.CheckOciDriverTaskProperties; + +/** Samples for ServiceTasks CreateOrUpdate. */ +public final class ServiceTasksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_CreateOrUpdate.json + */ + /** + * Sample code: Tasks_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .serviceTasks() + .createOrUpdateWithResponse( + "DmsSdkRg", + "DmsSdkService", + "DmsSdkTask", + new ProjectTaskInner() + .withProperties( + new CheckOciDriverTaskProperties() + .withInput(new CheckOciDriverTaskInput().withServerVersion("NA"))), + Context.NONE); + } +} +``` + +### ServiceTasks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTasks Delete. */ +public final class ServiceTasksDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, Context.NONE); + } +} +``` + +### ServiceTasks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTasks Get. */ +public final class ServiceTasksGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, Context.NONE); + } +} +``` + +### ServiceTasks_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceTasks List. */ +public final class ServiceTasksListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_List.json + */ + /** + * Sample code: ServiceTasks_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void serviceTasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().list("DmsSdkRg", "DmsSdkService", null, Context.NONE); + } +} +``` + +### ServiceTasks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CheckOciDriverTaskInput; +import com.azure.resourcemanager.datamigration.models.CheckOciDriverTaskProperties; + +/** Samples for ServiceTasks Update. */ +public final class ServiceTasksUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ServiceTasks_Update.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .serviceTasks() + .updateWithResponse( + "DmsSdkRg", + "DmsSdkService", + "DmsSdkTask", + new ProjectTaskInner() + .withProperties( + new CheckOciDriverTaskProperties() + .withInput(new CheckOciDriverTaskInput().withServerVersion("NA"))), + Context.NONE); + } +} +``` + +### Services_CheckChildrenNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** Samples for Services CheckChildrenNameAvailability. */ +public final class ServicesCheckChildrenNameAvailabilitySamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_CheckChildrenNameAvailability.json + */ + /** + * Sample code: Services_CheckChildrenNameAvailability. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCheckChildrenNameAvailability( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .services() + .checkChildrenNameAvailabilityWithResponse( + "DmsSdkRg", + "DmsSdkService", + new NameAvailabilityRequest().withName("Task1").withType("tasks"), + Context.NONE); + } +} +``` + +### Services_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** Samples for Services CheckNameAvailability. */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_CheckNameAvailability.json + */ + /** + * Sample code: Services_CheckNameAvailability. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCheckNameAvailability( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .services() + .checkNameAvailabilityWithResponse( + "eastus", new NameAvailabilityRequest().withName("DmsSdkService").withType("services"), Context.NONE); + } +} +``` + +### Services_CheckStatus + +```java +import com.azure.core.util.Context; + +/** Samples for Services CheckStatus. */ +public final class ServicesCheckStatusSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_CheckStatus.json + */ + /** + * Sample code: Services_CheckStatus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCheckStatus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().checkStatusWithResponse("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.ServiceSku; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_CreateOrUpdate.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .services() + .define("DmsSdkService") + .withRegion("southcentralus") + .withExistingResourceGroup("DmsSdkRg") + .withSku(new ServiceSku().withName("Basic_1vCore")) + .withVirtualSubnetId( + "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") + .create(); + } +} +``` + +### Services_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_Delete.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().delete("DmsSdkRg", "DmsSdkService", null, Context.NONE); + } +} +``` + +### Services_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_Get.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Services_List + +```java +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_List.json + */ + /** + * Sample code: Services_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().list(Context.NONE); + } +} +``` + +### Services_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_ListByResourceGroup.json + */ + /** + * Sample code: Services_ListByResourceGroup. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesListByResourceGroup( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().listByResourceGroup("DmsSdkRg", Context.NONE); + } +} +``` + +### Services_ListSkus + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListSkus. */ +public final class ServicesListSkusSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_ListSkus.json + */ + /** + * Sample code: Services_ListSkus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesListSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().listSkus("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Services_Start + +```java +import com.azure.core.util.Context; + +/** Samples for Services Start. */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_Start.json + */ + /** + * Sample code: Services_Start. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesStart(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().start("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Services_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for Services Stop. */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_Stop.json + */ + /** + * Sample code: Services_Stop. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesStop(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().stop("DmsSdkRg", "DmsSdkService", Context.NONE); + } +} +``` + +### Services_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.DataMigrationService; + +/** Samples for Services Update. */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Services_Update.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + DataMigrationService resource = + manager.services().getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", Context.NONE).getValue(); + resource + .update() + .withVirtualSubnetId( + "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") + .apply(); + } +} +``` + +### SqlMigrationServices_CreateOrUpdate + +```java +/** Samples for SqlMigrationServices CreateOrUpdate. */ +public final class SqlMigrationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/CreateOrUpdateMigrationServiceMAX.json + */ + /** + * Sample code: Create or Update SQL Migration Service with maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateSQLMigrationServiceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/CreateOrUpdateMigrationServiceMIN.json + */ + /** + * Sample code: Create or Update SQL Migration Service with minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateSQLMigrationServiceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } +} +``` + +### SqlMigrationServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices Delete. */ +public final class SqlMigrationServicesDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/DeleteMigrationService.json + */ + /** + * Sample code: Delete SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().delete("testrg", "service1", Context.NONE); + } +} +``` + +### SqlMigrationServices_DeleteNode + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; + +/** Samples for SqlMigrationServices DeleteNode. */ +public final class SqlMigrationServicesDeleteNodeSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/DeleteIntegrationRuntimeNode.json + */ + /** + * Sample code: Delete the integration runtime node. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteTheIntegrationRuntimeNode( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .sqlMigrationServices() + .deleteNodeWithResponse( + "testrg", + "service1", + new DeleteNodeInner().withNodeName("nodeName").withIntegrationRuntimeName("IRName"), + Context.NONE); + } +} +``` + +### SqlMigrationServices_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices GetByResourceGroup. */ +public final class SqlMigrationServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/GetMigrationService.json + */ + /** + * Sample code: Get Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().getByResourceGroupWithResponse("testrg", "service1", Context.NONE); + } +} +``` + +### SqlMigrationServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices List. */ +public final class SqlMigrationServicesListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ListBySubscriptionMigrationService.json + */ + /** + * Sample code: Get Services in the Subscriptions. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getServicesInTheSubscriptions( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().list(Context.NONE); + } +} +``` + +### SqlMigrationServices_ListAuthKeys + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices ListAuthKeys. */ +public final class SqlMigrationServicesListAuthKeysSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ListAuthKeysMigrationService.json + */ + /** + * Sample code: Retrieve the List of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void retrieveTheListOfAuthenticationKeys( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listAuthKeysWithResponse("testrg", "service1", Context.NONE); + } +} +``` + +### SqlMigrationServices_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices ListByResourceGroup. */ +public final class SqlMigrationServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ListByResourceGroupMigrationService.json + */ + /** + * Sample code: Get Migration Services in the Resource Group. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMigrationServicesInTheResourceGroup( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listByResourceGroup("testrg", Context.NONE); + } +} +``` + +### SqlMigrationServices_ListMigrations + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices ListMigrations. */ +public final class SqlMigrationServicesListMigrationsSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/ListMigrationsByMigrationService.json + */ + /** + * Sample code: List database migrations attached to the service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listDatabaseMigrationsAttachedToTheService( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listMigrations("testrg", "service1", Context.NONE); + } +} +``` + +### SqlMigrationServices_ListMonitoringData + +```java +import com.azure.core.util.Context; + +/** Samples for SqlMigrationServices ListMonitoringData. */ +public final class SqlMigrationServicesListMonitoringDataSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/GetMonitorDataMigrationService.json + */ + /** + * Sample code: Retrieve the Monitoring Data. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void retrieveTheMonitoringData(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listMonitoringDataWithResponse("testrg", "service1", Context.NONE); + } +} +``` + +### SqlMigrationServices_RegenerateAuthKeys + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** Samples for SqlMigrationServices RegenerateAuthKeys. */ +public final class SqlMigrationServicesRegenerateAuthKeysSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/RegenAuthKeysMigrationService.json + */ + /** + * Sample code: Regenerate the of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void regenerateTheOfAuthenticationKeys( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .sqlMigrationServices() + .regenerateAuthKeysWithResponse( + "testrg", "service1", new RegenAuthKeysInner().withKeyName("authKey1"), Context.NONE); + } +} +``` + +### SqlMigrationServices_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SqlMigrationServices Update. */ +public final class SqlMigrationServicesUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/UpdateMigrationService.json + */ + /** + * Sample code: Update SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void updateSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + SqlMigrationService resource = + manager + .sqlMigrationServices() + .getByResourceGroupWithResponse("testrg", "testagent", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Tasks_Cancel + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks Cancel. */ +public final class TasksCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", Context.NONE); + } +} +``` + +### Tasks_Command + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; + +/** Samples for Tasks Command. */ +public final class TasksCommandSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Command.json + */ + /** + * Sample code: Tasks_Command. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCommand(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .commandWithResponse( + "DmsSdkRg", + "DmsSdkService", + "DmsSdkProject", + "DmsSdkTask", + new MigrateSyncCompleteCommandProperties() + .withInput(new MigrateSyncCompleteCommandInput().withDatabaseName("TestDatabase")), + Context.NONE); + } +} +``` + +### Tasks_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.AuthenticationType; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; + +/** Samples for Tasks CreateOrUpdate. */ +public final class TasksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_CreateOrUpdate.json + */ + /** + * Sample code: Tasks_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .define("DmsSdkTask") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties( + new ConnectToTargetSqlDbTaskProperties() + .withInput( + new ConnectToTargetSqlDbTaskInput() + .withTargetConnectionInfo( + new SqlConnectionInfo() + .withUsername("testuser") + .withPassword("testpassword") + .withDataSource("ssma-test-server.database.windows.net") + .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) + .withEncryptConnection(true) + .withTrustServerCertificate(true)))) + .create(); + } +} +``` + +### Tasks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks Delete. */ +public final class TasksDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE); + } +} +``` + +### Tasks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks Get. */ +public final class TasksGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE); + } +} +``` + +### Tasks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_List.json + */ + /** + * Sample code: Tasks_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, Context.NONE); + } +} +``` + +### Tasks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.AuthenticationType; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; + +/** Samples for Tasks Update. */ +public final class TasksUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Update.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + ProjectTask resource = + manager + .tasks() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new ConnectToTargetSqlDbTaskProperties() + .withInput( + new ConnectToTargetSqlDbTaskInput() + .withTargetConnectionInfo( + new SqlConnectionInfo() + .withUsername("testuser") + .withPassword("testpassword") + .withDataSource("ssma-test-server.database.windows.net") + .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) + .withEncryptConnection(true) + .withTrustServerCertificate(true)))) + .apply(); + } +} +``` + +### Usages_List + +```java +import com.azure.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Usages_List.json + */ + /** + * Sample code: Services_Usages. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesUsages(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.usages().list("westus", Context.NONE); + } +} +``` + diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml index 2155b65c957bf..be1923e35a0ff 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml +++ b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-datamigration - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-datamigration + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DataMigration Management - This package contains Microsoft Azure SDK for DataMigration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Data Migration Client. Package tag package-2018-04-19. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DataMigration Management + This package contains Microsoft Azure SDK for DataMigration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Data Migration Client. Package tag package-preview-2022-03. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.27.0 - - - com.azure - azure-core-management - 1.5.4 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java index 5ffdfecb40632..70f5167e40d5e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java @@ -8,30 +8,45 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.DataMigrationManagementClient; import com.azure.resourcemanager.datamigration.implementation.DataMigrationManagementClientBuilder; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlDbsImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlMisImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlVmsImpl; +import com.azure.resourcemanager.datamigration.implementation.FilesImpl; import com.azure.resourcemanager.datamigration.implementation.OperationsImpl; import com.azure.resourcemanager.datamigration.implementation.ProjectsImpl; import com.azure.resourcemanager.datamigration.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.datamigration.implementation.ServiceTasksImpl; import com.azure.resourcemanager.datamigration.implementation.ServicesImpl; +import com.azure.resourcemanager.datamigration.implementation.SqlMigrationServicesImpl; import com.azure.resourcemanager.datamigration.implementation.TasksImpl; import com.azure.resourcemanager.datamigration.implementation.UsagesImpl; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlDbs; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlMis; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlVms; +import com.azure.resourcemanager.datamigration.models.Files; import com.azure.resourcemanager.datamigration.models.Operations; import com.azure.resourcemanager.datamigration.models.Projects; import com.azure.resourcemanager.datamigration.models.ResourceSkus; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; import com.azure.resourcemanager.datamigration.models.Services; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServices; import com.azure.resourcemanager.datamigration.models.Tasks; import com.azure.resourcemanager.datamigration.models.Usages; import java.time.Duration; @@ -39,20 +54,33 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to DataMigrationManager. Data Migration Client. */ public final class DataMigrationManager { + private DatabaseMigrationsSqlDbs databaseMigrationsSqlDbs; + + private DatabaseMigrationsSqlMis databaseMigrationsSqlMis; + + private DatabaseMigrationsSqlVms databaseMigrationsSqlVms; + + private Operations operations; + + private SqlMigrationServices sqlMigrationServices; + private ResourceSkus resourceSkus; private Services services; private Tasks tasks; + private ServiceTasks serviceTasks; + private Projects projects; private Usages usages; - private Operations operations; + private Files files; private final DataMigrationManagementClient clientObject; @@ -81,6 +109,19 @@ public static DataMigrationManager authenticate(TokenCredential credential, Azur return configure().authenticate(credential, profile); } + /** + * Creates an instance of DataMigration service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the DataMigration service API instance. + */ + public static DataMigrationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new DataMigrationManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create DataMigrationManager with optional configuration. * @@ -92,12 +133,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -136,6 +179,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -147,6 +201,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -154,9 +221,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -192,20 +261,38 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -217,6 +304,49 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil } } + /** @return Resource collection API of DatabaseMigrationsSqlDbs. */ + public DatabaseMigrationsSqlDbs databaseMigrationsSqlDbs() { + if (this.databaseMigrationsSqlDbs == null) { + this.databaseMigrationsSqlDbs = + new DatabaseMigrationsSqlDbsImpl(clientObject.getDatabaseMigrationsSqlDbs(), this); + } + return databaseMigrationsSqlDbs; + } + + /** @return Resource collection API of DatabaseMigrationsSqlMis. */ + public DatabaseMigrationsSqlMis databaseMigrationsSqlMis() { + if (this.databaseMigrationsSqlMis == null) { + this.databaseMigrationsSqlMis = + new DatabaseMigrationsSqlMisImpl(clientObject.getDatabaseMigrationsSqlMis(), this); + } + return databaseMigrationsSqlMis; + } + + /** @return Resource collection API of DatabaseMigrationsSqlVms. */ + public DatabaseMigrationsSqlVms databaseMigrationsSqlVms() { + if (this.databaseMigrationsSqlVms == null) { + this.databaseMigrationsSqlVms = + new DatabaseMigrationsSqlVmsImpl(clientObject.getDatabaseMigrationsSqlVms(), this); + } + return databaseMigrationsSqlVms; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of SqlMigrationServices. */ + public SqlMigrationServices sqlMigrationServices() { + if (this.sqlMigrationServices == null) { + this.sqlMigrationServices = new SqlMigrationServicesImpl(clientObject.getSqlMigrationServices(), this); + } + return sqlMigrationServices; + } + /** @return Resource collection API of ResourceSkus. */ public ResourceSkus resourceSkus() { if (this.resourceSkus == null) { @@ -241,6 +371,14 @@ public Tasks tasks() { return tasks; } + /** @return Resource collection API of ServiceTasks. */ + public ServiceTasks serviceTasks() { + if (this.serviceTasks == null) { + this.serviceTasks = new ServiceTasksImpl(clientObject.getServiceTasks(), this); + } + return serviceTasks; + } + /** @return Resource collection API of Projects. */ public Projects projects() { if (this.projects == null) { @@ -257,12 +395,12 @@ public Usages usages() { return usages; } - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + /** @return Resource collection API of Files. */ + public Files files() { + if (this.files == null) { + this.files = new FilesImpl(clientObject.getFiles(), this); } - return operations; + return files; } /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java index daa68b439ad0e..5e57f48e2a007 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java @@ -10,7 +10,7 @@ /** The interface for DataMigrationManagementClient class. */ public interface DataMigrationManagementClient { /** - * Gets Identifier of the subscription. + * Gets Subscription ID that identifies an Azure subscription. * * @return the subscriptionId value. */ @@ -44,6 +44,41 @@ public interface DataMigrationManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the DatabaseMigrationsSqlDbsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlDbsClient object. + */ + DatabaseMigrationsSqlDbsClient getDatabaseMigrationsSqlDbs(); + + /** + * Gets the DatabaseMigrationsSqlMisClient object to access its operations. + * + * @return the DatabaseMigrationsSqlMisClient object. + */ + DatabaseMigrationsSqlMisClient getDatabaseMigrationsSqlMis(); + + /** + * Gets the DatabaseMigrationsSqlVmsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlVmsClient object. + */ + DatabaseMigrationsSqlVmsClient getDatabaseMigrationsSqlVms(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SqlMigrationServicesClient object to access its operations. + * + * @return the SqlMigrationServicesClient object. + */ + SqlMigrationServicesClient getSqlMigrationServices(); + /** * Gets the ResourceSkusClient object to access its operations. * @@ -65,6 +100,13 @@ public interface DataMigrationManagementClient { */ TasksClient getTasks(); + /** + * Gets the ServiceTasksClient object to access its operations. + * + * @return the ServiceTasksClient object. + */ + ServiceTasksClient getServiceTasks(); + /** * Gets the ProjectsClient object to access its operations. * @@ -80,9 +122,9 @@ public interface DataMigrationManagementClient { UsagesClient getUsages(); /** - * Gets the OperationsClient object to access its operations. + * Gets the FilesClient object to access its operations. * - * @return the OperationsClient object. + * @return the FilesClient object. */ - OperationsClient getOperations(); + FilesClient getFiles(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java new file mode 100644 index 0000000000000..61e1ca1f35bed --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlDbsClient. */ +public interface DatabaseMigrationsSqlDbsClient { + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner get(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner createOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner createOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java new file mode 100644 index 0000000000000..a7b8ae2af1bd1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlMisClient. */ +public interface DatabaseMigrationsSqlMisClient { + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner get(String resourceGroupName, String managedInstanceName, String targetDbName); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner createOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner createOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java new file mode 100644 index 0000000000000..b98207a6b4232 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlVmsClient. */ +public interface DatabaseMigrationsSqlVmsClient { + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner createOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner createOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java new file mode 100644 index 0000000000000..71e1505ea6967 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; + +/** An instance of this class provides access to all the operations defined in FilesClient. */ +public interface FilesClient { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner get(String groupName, String serviceName, String projectName, String fileName); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner createOrUpdate( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters); + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner update( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters); + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileStorageInfoInner read(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java index e1b3352421e99..27d308babd64d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java @@ -8,29 +8,29 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java index 659400016b56d..bf7ca5a23d867 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java @@ -22,10 +22,10 @@ public interface ProjectsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String groupName, String serviceName); + PagedIterable list(String groupName, String serviceName); /** * The project resource is a nested resource representing a stored migration project. This method returns a list of @@ -37,10 +37,10 @@ public interface ProjectsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String groupName, String serviceName, Context context); + PagedIterable list(String groupName, String serviceName, Context context); /** * The project resource is a nested resource representing a stored migration project. The PUT method creates a new @@ -70,7 +70,7 @@ public interface ProjectsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -102,7 +102,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String groupName, String serviceName, String projectName, Context context); @@ -133,7 +133,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -167,7 +167,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java index 9f3b034006b6b..7b376fd91612f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java @@ -17,7 +17,7 @@ public interface ResourceSkusClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface ResourceSkusClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java new file mode 100644 index 0000000000000..356aa3e15172d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; + +/** An instance of this class provides access to all the operations defined in ServiceTasksClient. */ +public interface ServiceTasksClient { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner createOrUpdate(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner get(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner cancel(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java index 9776860991a80..d0cf0520f0091 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java @@ -34,9 +34,9 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters); @@ -56,9 +56,9 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); @@ -129,7 +129,7 @@ DataMigrationServiceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -145,9 +145,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String groupName, String serviceName, Boolean deleteRunningTasks); /** @@ -161,9 +161,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String groupName, String serviceName, Boolean deleteRunningTasks, Context context); @@ -220,9 +220,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters); @@ -238,9 +238,9 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); @@ -302,7 +302,7 @@ DataMigrationServiceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkStatusWithResponse( @@ -317,9 +317,9 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart(String groupName, String serviceName); /** @@ -332,9 +332,9 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStart(String groupName, String serviceName, Context context); /** @@ -374,9 +374,9 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop(String groupName, String serviceName); /** @@ -390,9 +390,9 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginStop(String groupName, String serviceName, Context context); /** @@ -433,7 +433,7 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listSkus(String groupName, String serviceName); @@ -448,7 +448,7 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listSkus(String groupName, String serviceName, Context context); @@ -465,7 +465,7 @@ Response checkStatusWithResponse( * @return indicates whether a proposed resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityResponseInner nestedCheckNameAvailability( + NameAvailabilityResponseInner checkChildrenNameAvailability( String groupName, String serviceName, NameAvailabilityRequest parameters); /** @@ -478,10 +478,10 @@ NameAvailabilityResponseInner nestedCheckNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); /** @@ -492,7 +492,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String groupName); @@ -506,7 +506,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String groupName, Context context); @@ -517,7 +517,7 @@ Response nestedCheckNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -530,7 +530,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -557,7 +557,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java new file mode 100644 index 0000000000000..51f24b5ec5790 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; + +/** An instance of this class provides access to all the operations defined in SqlMigrationServicesClient. */ +public interface SqlMigrationServicesClient { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters, Context context); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner createOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner createOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters, Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginUpdate( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner update( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner update( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthenticationKeysInner listAuthKeys(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegenAuthKeysInner regenerateAuthKeys( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeleteNodeInner deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteNodeWithResponse( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters, Context context); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeMonitoringDataInner listMonitoringData(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listMonitoringDataWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java index 339a1febafb4d..8ba64b22b8f01 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java @@ -9,6 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; /** An instance of this class provides access to all the operations defined in TasksClient. */ @@ -24,7 +25,7 @@ public interface TasksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String groupName, String serviceName, String projectName); @@ -42,7 +43,7 @@ public interface TasksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -81,7 +82,7 @@ ProjectTaskInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -121,7 +122,7 @@ Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -155,7 +156,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -199,7 +200,7 @@ ProjectTaskInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -238,9 +239,51 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response cancelWithResponse( String groupName, String serviceName, String projectName, String taskName, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPropertiesInner command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java index 4e8adef0cd7e6..f409cc8119e8c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java @@ -19,7 +19,7 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location); @@ -32,7 +32,7 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String location, Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java new file mode 100644 index 0000000000000..aecefbf5e424a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An authentication key. */ +@Fluent +public final class AuthenticationKeysInner { + /* + * The first authentication key. + */ + @JsonProperty(value = "authKey1") + private String authKey1; + + /* + * The second authentication key. + */ + @JsonProperty(value = "authKey2") + private String authKey2; + + /** + * Get the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + public String authKey1() { + return this.authKey1; + } + + /** + * Set the authKey1 property: The first authentication key. + * + * @param authKey1 the authKey1 value to set. + * @return the AuthenticationKeysInner object itself. + */ + public AuthenticationKeysInner withAuthKey1(String authKey1) { + this.authKey1 = authKey1; + return this; + } + + /** + * Get the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + public String authKey2() { + return this.authKey2; + } + + /** + * Set the authKey2 property: The second authentication key. + * + * @param authKey2 the authKey2 value to set. + * @return the AuthenticationKeysInner object itself. + */ + public AuthenticationKeysInner withAuthKey2(String authKey2) { + this.authKey2 = authKey2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java index d7fcbe65654d7..fcfdadc964b21 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuAutoGenerated; import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the available service SKU. */ @Fluent public final class AvailableServiceSkuInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuInner.class); - /* * The resource type, including the provider namespace */ @@ -26,7 +22,7 @@ public final class AvailableServiceSkuInner { * SKU name, tier, etc. */ @JsonProperty(value = "sku") - private AvailableServiceSkuAutoGenerated sku; + private AvailableServiceSkuSku sku; /* * A description of the scaling capacities of the SKU @@ -59,7 +55,7 @@ public AvailableServiceSkuInner withResourceType(String resourceType) { * * @return the sku value. */ - public AvailableServiceSkuAutoGenerated sku() { + public AvailableServiceSkuSku sku() { return this.sku; } @@ -69,7 +65,7 @@ public AvailableServiceSkuAutoGenerated sku() { * @param sku the sku value to set. * @return the AvailableServiceSkuInner object itself. */ - public AvailableServiceSkuInner withSku(AvailableServiceSkuAutoGenerated sku) { + public AvailableServiceSkuInner withSku(AvailableServiceSkuSku sku) { this.sku = sku; return this; } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java new file mode 100644 index 0000000000000..1ddf423562849 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.datamigration.models.CommandState; +import com.azure.resourcemanager.datamigration.models.MigrateMISyncCompleteCommandProperties; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; +import com.azure.resourcemanager.datamigration.models.MongoDbCancelCommand; +import com.azure.resourcemanager.datamigration.models.MongoDbFinishCommand; +import com.azure.resourcemanager.datamigration.models.MongoDbRestartCommand; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Base class for all types of DMS command properties. If command is not supported by current client, this object is + * returned. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "commandType", + defaultImpl = CommandPropertiesInner.class) +@JsonTypeName("CommandProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), + @JsonSubTypes.Type( + name = "Migrate.SqlServer.AzureDbSqlMi.Complete", + value = MigrateMISyncCompleteCommandProperties.class), + @JsonSubTypes.Type(name = "cancel", value = MongoDbCancelCommand.class), + @JsonSubTypes.Type(name = "finish", value = MongoDbFinishCommand.class), + @JsonSubTypes.Type(name = "restart", value = MongoDbRestartCommand.class) +}) +@Immutable +public class CommandPropertiesInner { + /* + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * The state of the command. This is ignored if submitted. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private CommandState state; + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + public CommandState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java index 410563e414e8f..1127109b5d42b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java @@ -5,21 +5,16 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; import com.azure.resourcemanager.datamigration.models.ServiceSku; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** A Database Migration Service resource. */ -@JsonFlatten @Fluent -public class DataMigrationServiceInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceInner.class); - +public final class DataMigrationServiceInner extends Resource { /* * HTTP strong entity tag value. Ignored if submitted */ @@ -33,30 +28,22 @@ public class DataMigrationServiceInner extends Resource { private String kind; /* - * Service SKU - */ - @JsonProperty(value = "sku") - private ServiceSku sku; - - /* - * The resource's provisioning state + * Custom service properties */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ServiceProvisioningState provisioningState; + @JsonProperty(value = "properties") + private DataMigrationServiceProperties innerProperties; /* - * The public key of the service, used to encrypt secrets sent to the - * service + * Service SKU */ - @JsonProperty(value = "properties.publicKey") - private String publicKey; + @JsonProperty(value = "sku") + private ServiceSku sku; /* - * The ID of the Microsoft.Network/virtualNetworks/subnets resource to - * which the service should be joined + * The systemData property. */ - @JsonProperty(value = "properties.virtualSubnetId") - private String virtualSubnetId; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** * Get the etag property: HTTP strong entity tag value. Ignored if submitted. @@ -98,6 +85,15 @@ public DataMigrationServiceInner withKind(String kind) { return this; } + /** + * Get the innerProperties property: Custom service properties. + * + * @return the innerProperties value. + */ + private DataMigrationServiceProperties innerProperties() { + return this.innerProperties; + } + /** * Get the sku property: Service SKU. * @@ -118,13 +114,36 @@ public DataMigrationServiceInner withSku(ServiceSku sku) { return this; } + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public DataMigrationServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataMigrationServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the provisioningState property: The resource's provisioning state. * * @return the provisioningState value. */ public ServiceProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -133,7 +152,7 @@ public ServiceProvisioningState provisioningState() { * @return the publicKey value. */ public String publicKey() { - return this.publicKey; + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); } /** @@ -143,7 +162,10 @@ public String publicKey() { * @return the DataMigrationServiceInner object itself. */ public DataMigrationServiceInner withPublicKey(String publicKey) { - this.publicKey = publicKey; + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withPublicKey(publicKey); return this; } @@ -154,7 +176,7 @@ public DataMigrationServiceInner withPublicKey(String publicKey) { * @return the virtualSubnetId value. */ public String virtualSubnetId() { - return this.virtualSubnetId; + return this.innerProperties() == null ? null : this.innerProperties().virtualSubnetId(); } /** @@ -165,21 +187,81 @@ public String virtualSubnetId() { * @return the DataMigrationServiceInner object itself. */ public DataMigrationServiceInner withVirtualSubnetId(String virtualSubnetId) { - this.virtualSubnetId = virtualSubnetId; + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withVirtualSubnetId(virtualSubnetId); return this; } - /** {@inheritDoc} */ - @Override - public DataMigrationServiceInner withLocation(String location) { - super.withLocation(location); + /** + * Get the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @return the virtualNicId value. + */ + public String virtualNicId() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNicId(); + } + + /** + * Set the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @param virtualNicId the virtualNicId value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualNicId(String virtualNicId) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withVirtualNicId(virtualNicId); return this; } - /** {@inheritDoc} */ - @Override - public DataMigrationServiceInner withTags(Map tags) { - super.withTags(tags); + /** + * Get the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @return the autoStopDelay value. + */ + public String autoStopDelay() { + return this.innerProperties() == null ? null : this.innerProperties().autoStopDelay(); + } + + /** + * Set the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @param autoStopDelay the autoStopDelay value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withAutoStopDelay(String autoStopDelay) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withAutoStopDelay(autoStopDelay); + return this; + } + + /** + * Get the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @return the deleteResourcesOnStop value. + */ + public Boolean deleteResourcesOnStop() { + return this.innerProperties() == null ? null : this.innerProperties().deleteResourcesOnStop(); + } + + /** + * Set the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @param deleteResourcesOnStop the deleteResourcesOnStop value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withDeleteResourcesOnStop(Boolean deleteResourcesOnStop) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withDeleteResourcesOnStop(deleteResourcesOnStop); return this; } @@ -189,6 +271,9 @@ public DataMigrationServiceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } if (sku() != null) { sku().validate(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java new file mode 100644 index 0000000000000..9a11b1d691587 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Database Migration Service instance. */ +@Fluent +public final class DataMigrationServiceProperties { + /* + * The resource's provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceProvisioningState provisioningState; + + /* + * The public key of the service, used to encrypt secrets sent to the + * service + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * The ID of the Microsoft.Network/virtualNetworks/subnets resource to + * which the service should be joined + */ + @JsonProperty(value = "virtualSubnetId") + private String virtualSubnetId; + + /* + * The ID of the Microsoft.Network/networkInterfaces resource which the + * service have + */ + @JsonProperty(value = "virtualNicId") + private String virtualNicId; + + /* + * The time delay before the service is auto-stopped when idle. + */ + @JsonProperty(value = "autoStopDelay") + private String autoStopDelay; + + /* + * Whether service resources should be deleted when stopped. (Turned on by + * default) + */ + @JsonProperty(value = "deleteResourcesOnStop") + private Boolean deleteResourcesOnStop; + + /** + * Get the provisioningState property: The resource's provisioning state. + * + * @return the provisioningState value. + */ + public ServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicKey property: The public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: The public key of the service, used to encrypt secrets sent to the service. + * + * @param publicKey the publicKey value to set. + * @return the DataMigrationServiceProperties object itself. + */ + public DataMigrationServiceProperties withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * + * @return the virtualSubnetId value. + */ + public String virtualSubnetId() { + return this.virtualSubnetId; + } + + /** + * Set the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * + * @param virtualSubnetId the virtualSubnetId value to set. + * @return the DataMigrationServiceProperties object itself. + */ + public DataMigrationServiceProperties withVirtualSubnetId(String virtualSubnetId) { + this.virtualSubnetId = virtualSubnetId; + return this; + } + + /** + * Get the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @return the virtualNicId value. + */ + public String virtualNicId() { + return this.virtualNicId; + } + + /** + * Set the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @param virtualNicId the virtualNicId value to set. + * @return the DataMigrationServiceProperties object itself. + */ + public DataMigrationServiceProperties withVirtualNicId(String virtualNicId) { + this.virtualNicId = virtualNicId; + return this; + } + + /** + * Get the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @return the autoStopDelay value. + */ + public String autoStopDelay() { + return this.autoStopDelay; + } + + /** + * Set the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @param autoStopDelay the autoStopDelay value to set. + * @return the DataMigrationServiceProperties object itself. + */ + public DataMigrationServiceProperties withAutoStopDelay(String autoStopDelay) { + this.autoStopDelay = autoStopDelay; + return this; + } + + /** + * Get the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @return the deleteResourcesOnStop value. + */ + public Boolean deleteResourcesOnStop() { + return this.deleteResourcesOnStop; + } + + /** + * Set the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @param deleteResourcesOnStop the deleteResourcesOnStop value to set. + * @return the DataMigrationServiceProperties object itself. + */ + public DataMigrationServiceProperties withDeleteResourcesOnStop(Boolean deleteResourcesOnStop) { + this.deleteResourcesOnStop = deleteResourcesOnStop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java index b53702e4088b7..2fe999be182f4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java @@ -5,22 +5,24 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Service health status. */ @Fluent public final class DataMigrationServiceStatusResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceStatusResponseInner.class); - /* * The DMS instance agent version */ @JsonProperty(value = "agentVersion") private String agentVersion; + /* + * Agent Configuration + */ + @JsonProperty(value = "agentConfiguration") + private Object agentConfiguration; + /* * The machine-readable status, such as 'Initializing', 'Offline', * 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', @@ -61,6 +63,26 @@ public DataMigrationServiceStatusResponseInner withAgentVersion(String agentVers return this; } + /** + * Get the agentConfiguration property: Agent Configuration. + * + * @return the agentConfiguration value. + */ + public Object agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the agentConfiguration property: Agent Configuration. + * + * @param agentConfiguration the agentConfiguration value to set. + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withAgentConfiguration(Object agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + /** * Get the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java new file mode 100644 index 0000000000000..c8a3ac62fd0eb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource. */ +@Fluent +public final class DatabaseMigrationInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Database Migration Resource properties. + */ + @JsonProperty(value = "properties") + private DatabaseMigrationProperties properties; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Database Migration Resource properties. + * + * @return the properties value. + */ + public DatabaseMigrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationInner object itself. + */ + public DatabaseMigrationInner withProperties(DatabaseMigrationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java new file mode 100644 index 0000000000000..5e132ade44b69 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource for SQL Database. */ +@Fluent +public final class DatabaseMigrationSqlDbInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Database Migration Resource properties for SQL database. + */ + @JsonProperty(value = "properties") + private DatabaseMigrationPropertiesSqlDb properties; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Database Migration Resource properties for SQL database. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlDb properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL database. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlDbInner object itself. + */ + public DatabaseMigrationSqlDbInner withProperties(DatabaseMigrationPropertiesSqlDb properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java new file mode 100644 index 0000000000000..aa323fd767431 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource for SQL Managed Instance. */ +@Fluent +public final class DatabaseMigrationSqlMiInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Database Migration Resource properties for SQL Managed Instance. + */ + @JsonProperty(value = "properties") + private DatabaseMigrationPropertiesSqlMi properties; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlMi properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlMiInner object itself. + */ + public DatabaseMigrationSqlMiInner withProperties(DatabaseMigrationPropertiesSqlMi properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java new file mode 100644 index 0000000000000..d808380ad2d5d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource for SQL Virtual Machine. */ +@Fluent +public final class DatabaseMigrationSqlVmInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Database Migration Resource properties for SQL Virtual Machine. + */ + @JsonProperty(value = "properties") + private DatabaseMigrationPropertiesSqlVm properties; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlVm properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlVmInner object itself. + */ + public DatabaseMigrationSqlVmInner withProperties(DatabaseMigrationPropertiesSqlVm properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java new file mode 100644 index 0000000000000..64ad3d4dca92d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of node to be deleted. */ +@Fluent +public final class DeleteNodeInner { + /* + * The name of node to delete. + */ + @JsonProperty(value = "nodeName") + private String nodeName; + + /* + * The name of integration runtime. + */ + @JsonProperty(value = "integrationRuntimeName") + private String integrationRuntimeName; + + /** + * Get the nodeName property: The name of node to delete. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the nodeName property: The name of node to delete. + * + * @param nodeName the nodeName value to set. + * @return the DeleteNodeInner object itself. + */ + public DeleteNodeInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the integrationRuntimeName property: The name of integration runtime. + * + * @return the integrationRuntimeName value. + */ + public String integrationRuntimeName() { + return this.integrationRuntimeName; + } + + /** + * Set the integrationRuntimeName property: The name of integration runtime. + * + * @param integrationRuntimeName the integrationRuntimeName value to set. + * @return the DeleteNodeInner object itself. + */ + public DeleteNodeInner withIntegrationRuntimeName(String integrationRuntimeName) { + this.integrationRuntimeName = integrationRuntimeName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java new file mode 100644 index 0000000000000..c5b833459c95b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** File storage information. */ +@Fluent +public final class FileStorageInfoInner { + /* + * A URI that can be used to access the file content. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * Dictionary of + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /** + * Get the uri property: A URI that can be used to access the file content. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: A URI that can be used to access the file content. + * + * @param uri the uri value to set. + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the headers property: Dictionary of <string>. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: Dictionary of <string>. + * + * @param headers the headers value to set. + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java new file mode 100644 index 0000000000000..96e0c51f240b3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.datamigration.models.NodeMonitoringData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Integration Runtime Monitoring Data. */ +@Immutable +public final class IntegrationRuntimeMonitoringDataInner { + /* + * The name of Integration Runtime. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Integration Runtime node monitoring data. + */ + @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY) + private List nodes; + + /** + * Get the name property: The name of Integration Runtime. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the nodes property: Integration Runtime node monitoring data. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java index d80dbc0a2a7bd..dab839be3bcfa 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java @@ -4,35 +4,31 @@ package com.azure.resourcemanager.datamigration.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.datamigration.models.NameCheckFailureReason; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Indicates whether a proposed resource name is available. */ -@Immutable +@Fluent public final class NameAvailabilityResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityResponseInner.class); - /* * If true, the name is valid and available. If false, 'reason' describes * why not. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "nameAvailable") private Boolean nameAvailable; /* * The reason why the name is not available, if nameAvailable is false */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "reason") private NameCheckFailureReason reason; /* * The localized reason why the name is not available, if nameAvailable is * false */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "message") private String message; /** @@ -44,6 +40,17 @@ public Boolean nameAvailable() { return this.nameAvailable; } + /** + * Set the nameAvailable property: If true, the name is valid and available. If false, 'reason' describes why not. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + /** * Get the reason property: The reason why the name is not available, if nameAvailable is false. * @@ -53,6 +60,17 @@ public NameCheckFailureReason reason() { return this.reason; } + /** + * Set the reason property: The reason why the name is not available, if nameAvailable is false. + * + * @param reason the reason value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withReason(NameCheckFailureReason reason) { + this.reason = reason; + return this; + } + /** * Get the message property: The localized reason why the name is not available, if nameAvailable is false. * @@ -62,6 +80,17 @@ public String message() { return this.message; } + /** + * Set the message property: The localized reason why the name is not available, if nameAvailable is false. + * + * @param message the message value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java new file mode 100644 index 0000000000000..b440665eaeee6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datamigration.models.OperationOrigin; +import com.azure.resourcemanager.datamigration.models.OperationsDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The OperationsDefinition model. */ +@Fluent +public final class OperationsDefinitionInner { + /* + * The name property. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * The display property. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationsDisplayDefinition display; + + /* + * The origin property. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /* + * Dictionary of + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The display property. + * + * @return the display value. + */ + public OperationsDisplayDefinition display() { + return this.display; + } + + /** + * Get the origin property: The origin property. + * + * @return the origin value. + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get the properties property: Dictionary of <AnyObject>. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java new file mode 100644 index 0000000000000..52b9ab65f64a8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A file resource. */ +@Fluent +public final class ProjectFileInner extends ProxyResource { + /* + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Custom file properties + */ + @JsonProperty(value = "properties") + private ProjectFileProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties property: Custom file properties. + * + * @return the properties value. + */ + public ProjectFileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Custom file properties. + * + * @param properties the properties value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withProperties(ProjectFileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java index 478836c6d79e2..27e08e768a3a3 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java @@ -5,67 +5,91 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; import com.azure.resourcemanager.datamigration.models.ConnectionInfo; import com.azure.resourcemanager.datamigration.models.DatabaseInfo; import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; /** A project resource. */ -@JsonFlatten @Fluent -public class ProjectInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectInner.class); - +public final class ProjectInner extends Resource { /* - * Source platform for the project + * Project properties */ - @JsonProperty(value = "properties.sourcePlatform") - private ProjectSourcePlatform sourcePlatform; + @JsonProperty(value = "properties") + private ProjectProperties innerProperties; /* - * Target platform for the project + * HTTP strong entity tag value. This is ignored if submitted. */ - @JsonProperty(value = "properties.targetPlatform") - private ProjectTargetPlatform targetPlatform; + @JsonProperty(value = "etag") + private String etag; /* - * UTC Date and time when project was created + * The systemData property. */ - @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTime; + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; - /* - * Information for connecting to source + /** + * Get the innerProperties property: Project properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.sourceConnectionInfo") - private ConnectionInfo sourceConnectionInfo; + private ProjectProperties innerProperties() { + return this.innerProperties; + } - /* - * Information for connecting to target + /** + * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. */ - @JsonProperty(value = "properties.targetConnectionInfo") - private ConnectionInfo targetConnectionInfo; + public String etag() { + return this.etag; + } - /* - * List of DatabaseInfo + /** + * Set the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set. + * @return the ProjectInner object itself. */ - @JsonProperty(value = "properties.databasesInfo") - private List databasesInfo; + public ProjectInner withEtag(String etag) { + this.etag = etag; + return this; + } - /* - * The project's provisioning state + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProjectProvisioningState provisioningState; + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ProjectInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProjectInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the sourcePlatform property: Source platform for the project. @@ -73,7 +97,7 @@ public class ProjectInner extends Resource { * @return the sourcePlatform value. */ public ProjectSourcePlatform sourcePlatform() { - return this.sourcePlatform; + return this.innerProperties() == null ? null : this.innerProperties().sourcePlatform(); } /** @@ -83,7 +107,35 @@ public ProjectSourcePlatform sourcePlatform() { * @return the ProjectInner object itself. */ public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { - this.sourcePlatform = sourcePlatform; + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withSourcePlatform(sourcePlatform); + return this; + } + + /** + * Get the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @return the azureAuthenticationInfo value. + */ + public AzureActiveDirectoryApp azureAuthenticationInfo() { + return this.innerProperties() == null ? null : this.innerProperties().azureAuthenticationInfo(); + } + + /** + * Set the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @param azureAuthenticationInfo the azureAuthenticationInfo value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withAzureAuthenticationInfo(azureAuthenticationInfo); return this; } @@ -93,7 +145,7 @@ public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { * @return the targetPlatform value. */ public ProjectTargetPlatform targetPlatform() { - return this.targetPlatform; + return this.innerProperties() == null ? null : this.innerProperties().targetPlatform(); } /** @@ -103,7 +155,10 @@ public ProjectTargetPlatform targetPlatform() { * @return the ProjectInner object itself. */ public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { - this.targetPlatform = targetPlatform; + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withTargetPlatform(targetPlatform); return this; } @@ -113,7 +168,7 @@ public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { * @return the creationTime value. */ public OffsetDateTime creationTime() { - return this.creationTime; + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); } /** @@ -122,7 +177,7 @@ public OffsetDateTime creationTime() { * @return the sourceConnectionInfo value. */ public ConnectionInfo sourceConnectionInfo() { - return this.sourceConnectionInfo; + return this.innerProperties() == null ? null : this.innerProperties().sourceConnectionInfo(); } /** @@ -132,7 +187,10 @@ public ConnectionInfo sourceConnectionInfo() { * @return the ProjectInner object itself. */ public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { - this.sourceConnectionInfo = sourceConnectionInfo; + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withSourceConnectionInfo(sourceConnectionInfo); return this; } @@ -142,7 +200,7 @@ public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo * @return the targetConnectionInfo value. */ public ConnectionInfo targetConnectionInfo() { - return this.targetConnectionInfo; + return this.innerProperties() == null ? null : this.innerProperties().targetConnectionInfo(); } /** @@ -152,7 +210,10 @@ public ConnectionInfo targetConnectionInfo() { * @return the ProjectInner object itself. */ public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { - this.targetConnectionInfo = targetConnectionInfo; + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withTargetConnectionInfo(targetConnectionInfo); return this; } @@ -162,7 +223,7 @@ public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo * @return the databasesInfo value. */ public List databasesInfo() { - return this.databasesInfo; + return this.innerProperties() == null ? null : this.innerProperties().databasesInfo(); } /** @@ -172,7 +233,10 @@ public List databasesInfo() { * @return the ProjectInner object itself. */ public ProjectInner withDatabasesInfo(List databasesInfo) { - this.databasesInfo = databasesInfo; + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withDatabasesInfo(databasesInfo); return this; } @@ -182,21 +246,7 @@ public ProjectInner withDatabasesInfo(List databasesInfo) { * @return the provisioningState value. */ public ProjectProvisioningState provisioningState() { - return this.provisioningState; - } - - /** {@inheritDoc} */ - @Override - public ProjectInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ProjectInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -205,14 +255,8 @@ public ProjectInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sourceConnectionInfo() != null) { - sourceConnectionInfo().validate(); - } - if (targetConnectionInfo() != null) { - targetConnectionInfo().validate(); - } - if (databasesInfo() != null) { - databasesInfo().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java new file mode 100644 index 0000000000000..440c057e2c9a5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; +import com.azure.resourcemanager.datamigration.models.ConnectionInfo; +import com.azure.resourcemanager.datamigration.models.DatabaseInfo; +import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Project-specific properties. */ +@Fluent +public final class ProjectProperties { + /* + * Source platform for the project + */ + @JsonProperty(value = "sourcePlatform", required = true) + private ProjectSourcePlatform sourcePlatform; + + /* + * Field that defines the Azure active directory application info, used to + * connect to the target Azure resource + */ + @JsonProperty(value = "azureAuthenticationInfo") + private AzureActiveDirectoryApp azureAuthenticationInfo; + + /* + * Target platform for the project + */ + @JsonProperty(value = "targetPlatform", required = true) + private ProjectTargetPlatform targetPlatform; + + /* + * UTC Date and time when project was created + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Information for connecting to source + */ + @JsonProperty(value = "sourceConnectionInfo") + private ConnectionInfo sourceConnectionInfo; + + /* + * Information for connecting to target + */ + @JsonProperty(value = "targetConnectionInfo") + private ConnectionInfo targetConnectionInfo; + + /* + * List of DatabaseInfo + */ + @JsonProperty(value = "databasesInfo") + private List databasesInfo; + + /* + * The project's provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProjectProvisioningState provisioningState; + + /** + * Get the sourcePlatform property: Source platform for the project. + * + * @return the sourcePlatform value. + */ + public ProjectSourcePlatform sourcePlatform() { + return this.sourcePlatform; + } + + /** + * Set the sourcePlatform property: Source platform for the project. + * + * @param sourcePlatform the sourcePlatform value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.sourcePlatform = sourcePlatform; + return this; + } + + /** + * Get the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @return the azureAuthenticationInfo value. + */ + public AzureActiveDirectoryApp azureAuthenticationInfo() { + return this.azureAuthenticationInfo; + } + + /** + * Set the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @param azureAuthenticationInfo the azureAuthenticationInfo value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo) { + this.azureAuthenticationInfo = azureAuthenticationInfo; + return this; + } + + /** + * Get the targetPlatform property: Target platform for the project. + * + * @return the targetPlatform value. + */ + public ProjectTargetPlatform targetPlatform() { + return this.targetPlatform; + } + + /** + * Set the targetPlatform property: Target platform for the project. + * + * @param targetPlatform the targetPlatform value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get the creationTime property: UTC Date and time when project was created. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the sourceConnectionInfo property: Information for connecting to source. + * + * @return the sourceConnectionInfo value. + */ + public ConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + public ConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the databasesInfo property: List of DatabaseInfo. + * + * @return the databasesInfo value. + */ + public List databasesInfo() { + return this.databasesInfo; + } + + /** + * Set the databasesInfo property: List of DatabaseInfo. + * + * @param databasesInfo the databasesInfo value to set. + * @return the ProjectProperties object itself. + */ + public ProjectProperties withDatabasesInfo(List databasesInfo) { + this.databasesInfo = databasesInfo; + return this; + } + + /** + * Get the provisioningState property: The project's provisioning state. + * + * @return the provisioningState value. + */ + public ProjectProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourcePlatform() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourcePlatform in model ProjectProperties")); + } + if (azureAuthenticationInfo() != null) { + azureAuthenticationInfo().validate(); + } + if (targetPlatform() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetPlatform in model ProjectProperties")); + } + if (sourceConnectionInfo() != null) { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() != null) { + targetConnectionInfo().validate(); + } + if (databasesInfo() != null) { + databasesInfo().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProjectProperties.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java index 7e38d4be1d3d4..8b8506a877c99 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java @@ -6,16 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A task resource. */ @Fluent public final class ProjectTaskInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectTaskInner.class); - /* * HTTP strong entity tag value. This is ignored if submitted. */ @@ -28,6 +25,12 @@ public final class ProjectTaskInner extends ProxyResource { @JsonProperty(value = "properties") private ProjectTaskProperties properties; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. * @@ -68,6 +71,15 @@ public ProjectTaskInner withProperties(ProjectTaskProperties properties) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java index d5e768228b113..b2824f937de16 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.models.QuotaName; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes a quota for or usage details about a resource. */ @Fluent public final class QuotaInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaInner.class); - /* * The current value of the quota. If null or missing, the current value * cannot be determined in the context of the request. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java new file mode 100644 index 0000000000000..5f1731d2b4b7b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An authentication key to regenerate. */ +@Fluent +public final class RegenAuthKeysInner { + /* + * The name of authentication key to generate. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * The first authentication key. + */ + @JsonProperty(value = "authKey1") + private String authKey1; + + /* + * The second authentication key. + */ + @JsonProperty(value = "authKey2") + private String authKey2; + + /** + * Get the keyName property: The name of authentication key to generate. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of authentication key to generate. + * + * @param keyName the keyName value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + public String authKey1() { + return this.authKey1; + } + + /** + * Set the authKey1 property: The first authentication key. + * + * @param authKey1 the authKey1 value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withAuthKey1(String authKey1) { + this.authKey1 = authKey1; + return this; + } + + /** + * Get the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + public String authKey2() { + return this.authKey2; + } + + /** + * Set the authKey2 property: The second authentication key. + * + * @param authKey2 the authKey2 value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withAuthKey2(String authKey2) { + this.authKey2 = authKey2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java index 2fbc5472bd095..924dcce6554f0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.models.ResourceSkuCapabilities; import com.azure.resourcemanager.datamigration.models.ResourceSkuCapacity; import com.azure.resourcemanager.datamigration.models.ResourceSkuCosts; import com.azure.resourcemanager.datamigration.models.ResourceSkuRestrictions; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes an available DMS SKU. */ @Immutable public final class ResourceSkuInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuInner.class); - /* * The type of resource the SKU applies to. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java deleted file mode 100644 index 0809e0e4d86f0..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of an action supported by the Database Migration Service. */ -@Fluent -public final class ServiceOperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationInner.class); - - /* - * The fully qualified action name, e.g. - * Microsoft.DataMigration/services/read - */ - @JsonProperty(value = "name") - private String name; - - /* - * Localized display text - */ - @JsonProperty(value = "display") - private ServiceOperationDisplay display; - - /** - * Get the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @param name the name value to set. - * @return the ServiceOperationInner object itself. - */ - public ServiceOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Localized display text. - * - * @return the display value. - */ - public ServiceOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display text. - * - * @param display the display value to set. - * @return the ServiceOperationInner object itself. - */ - public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java new file mode 100644 index 0000000000000..4e5a775944a24 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A SQL Migration Service. */ +@Fluent +public final class SqlMigrationServiceInner extends Resource { + /* + * The SQL Migration Service properties. + */ + @JsonProperty(value = "properties") + private SqlMigrationServiceProperties innerProperties; + + /* + * The systemData property. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The SQL Migration Service properties. + * + * @return the innerProperties value. + */ + private SqlMigrationServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SqlMigrationServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlMigrationServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.innerProperties() == null ? null : this.innerProperties().integrationRuntimeState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java new file mode 100644 index 0000000000000..358a1f5789dde --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SQL Migration Service properties. */ +@Immutable +public final class SqlMigrationServiceProperties { + /* + * Provisioning state to track the async operation status. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Current state of the Integration runtime. + */ + @JsonProperty(value = "integrationRuntimeState", access = JsonProperty.Access.WRITE_ONLY) + private String integrationRuntimeState; + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.integrationRuntimeState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java similarity index 52% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java index 67bb7306fa126..073693b4db501 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java @@ -4,31 +4,30 @@ package com.azure.resourcemanager.datamigration.implementation; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperation; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; -public final class ServiceOperationImpl implements ServiceOperation { - private ServiceOperationInner innerObject; +public final class AuthenticationKeysImpl implements AuthenticationKeys { + private AuthenticationKeysInner innerObject; private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; - ServiceOperationImpl( - ServiceOperationInner innerObject, + AuthenticationKeysImpl( + AuthenticationKeysInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); + public String authKey1() { + return this.innerModel().authKey1(); } - public ServiceOperationDisplay display() { - return this.innerModel().display(); + public String authKey2() { + return this.innerModel().authKey2(); } - public ServiceOperationInner innerModel() { + public AuthenticationKeysInner innerModel() { return this.innerObject; } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java index e9c35aa62436e..13ab64ec02fcb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java @@ -6,8 +6,8 @@ import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; import com.azure.resourcemanager.datamigration.models.AvailableServiceSku; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuAutoGenerated; import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; public final class AvailableServiceSkuImpl implements AvailableServiceSku { private AvailableServiceSkuInner innerObject; @@ -25,7 +25,7 @@ public String resourceType() { return this.innerModel().resourceType(); } - public AvailableServiceSkuAutoGenerated sku() { + public AvailableServiceSkuSku sku() { return this.innerModel().sku(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java new file mode 100644 index 0000000000000..5ae5c74ee66ba --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; +import com.azure.resourcemanager.datamigration.models.CommandState; +import java.util.Collections; +import java.util.List; + +public final class CommandPropertiesImpl implements CommandProperties { + private CommandPropertiesInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + CommandPropertiesImpl( + CommandPropertiesInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CommandState state() { + return this.innerModel().state(); + } + + public CommandPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java index d28dc06eb2a3a..9515832621634 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -19,12 +18,12 @@ @ServiceClientBuilder(serviceClients = {DataMigrationManagementClientImpl.class}) public final class DataMigrationManagementClientBuilder { /* - * Identifier of the subscription + * Subscription ID that identifies an Azure subscription. */ private String subscriptionId; /** - * Sets Identifier of the subscription. + * Sets Subscription ID that identifies an Azure subscription. * * @param subscriptionId the subscriptionId value. * @return the DataMigrationManagementClientBuilder. @@ -67,34 +66,34 @@ public DataMigrationManagementClientBuilder environment(AzureEnvironment environ } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the DataMigrationManagementClientBuilder. */ - public DataMigrationManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public DataMigrationManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the DataMigrationManagementClientBuilder. */ - public DataMigrationManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DataMigrationManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,21 +119,21 @@ public DataMigrationManagementClientBuilder serializerAdapter(SerializerAdapter * @return an instance of DataMigrationManagementClientImpl. */ public DataMigrationManagementClientImpl buildClient() { + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (endpoint == null) { this.endpoint = "https://management.azure.com"; } if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java index d8cb91cfe406e..007fe88480d78 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java @@ -22,10 +22,16 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.datamigration.fluent.DataMigrationManagementClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; import com.azure.resourcemanager.datamigration.fluent.ProjectsClient; import com.azure.resourcemanager.datamigration.fluent.ResourceSkusClient; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; import com.azure.resourcemanager.datamigration.fluent.ServicesClient; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; import com.azure.resourcemanager.datamigration.fluent.TasksClient; import com.azure.resourcemanager.datamigration.fluent.UsagesClient; import java.io.IOException; @@ -41,13 +47,11 @@ /** Initializes a new instance of the DataMigrationManagementClientImpl type. */ @ServiceClient(builder = DataMigrationManagementClientBuilder.class) public final class DataMigrationManagementClientImpl implements DataMigrationManagementClient { - private final ClientLogger logger = new ClientLogger(DataMigrationManagementClientImpl.class); - - /** Identifier of the subscription. */ + /** Subscription ID that identifies an Azure subscription. */ private final String subscriptionId; /** - * Gets Identifier of the subscription. + * Gets Subscription ID that identifies an Azure subscription. * * @return the subscriptionId value. */ @@ -115,6 +119,66 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** The DatabaseMigrationsSqlDbsClient object to access its operations. */ + private final DatabaseMigrationsSqlDbsClient databaseMigrationsSqlDbs; + + /** + * Gets the DatabaseMigrationsSqlDbsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlDbsClient object. + */ + public DatabaseMigrationsSqlDbsClient getDatabaseMigrationsSqlDbs() { + return this.databaseMigrationsSqlDbs; + } + + /** The DatabaseMigrationsSqlMisClient object to access its operations. */ + private final DatabaseMigrationsSqlMisClient databaseMigrationsSqlMis; + + /** + * Gets the DatabaseMigrationsSqlMisClient object to access its operations. + * + * @return the DatabaseMigrationsSqlMisClient object. + */ + public DatabaseMigrationsSqlMisClient getDatabaseMigrationsSqlMis() { + return this.databaseMigrationsSqlMis; + } + + /** The DatabaseMigrationsSqlVmsClient object to access its operations. */ + private final DatabaseMigrationsSqlVmsClient databaseMigrationsSqlVms; + + /** + * Gets the DatabaseMigrationsSqlVmsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlVmsClient object. + */ + public DatabaseMigrationsSqlVmsClient getDatabaseMigrationsSqlVms() { + return this.databaseMigrationsSqlVms; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SqlMigrationServicesClient object to access its operations. */ + private final SqlMigrationServicesClient sqlMigrationServices; + + /** + * Gets the SqlMigrationServicesClient object to access its operations. + * + * @return the SqlMigrationServicesClient object. + */ + public SqlMigrationServicesClient getSqlMigrationServices() { + return this.sqlMigrationServices; + } + /** The ResourceSkusClient object to access its operations. */ private final ResourceSkusClient resourceSkus; @@ -151,6 +215,18 @@ public TasksClient getTasks() { return this.tasks; } + /** The ServiceTasksClient object to access its operations. */ + private final ServiceTasksClient serviceTasks; + + /** + * Gets the ServiceTasksClient object to access its operations. + * + * @return the ServiceTasksClient object. + */ + public ServiceTasksClient getServiceTasks() { + return this.serviceTasks; + } + /** The ProjectsClient object to access its operations. */ private final ProjectsClient projects; @@ -175,16 +251,16 @@ public UsagesClient getUsages() { return this.usages; } - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; + /** The FilesClient object to access its operations. */ + private final FilesClient files; /** - * Gets the OperationsClient object to access its operations. + * Gets the FilesClient object to access its operations. * - * @return the OperationsClient object. + * @return the FilesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public FilesClient getFiles() { + return this.files; } /** @@ -194,7 +270,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId Identifier of the subscription. + * @param subscriptionId Subscription ID that identifies an Azure subscription. * @param endpoint server parameter. */ DataMigrationManagementClientImpl( @@ -209,13 +285,19 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-04-19"; + this.apiVersion = "2022-03-30-preview"; + this.databaseMigrationsSqlDbs = new DatabaseMigrationsSqlDbsClientImpl(this); + this.databaseMigrationsSqlMis = new DatabaseMigrationsSqlMisClientImpl(this); + this.databaseMigrationsSqlVms = new DatabaseMigrationsSqlVmsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.sqlMigrationServices = new SqlMigrationServicesClientImpl(this); this.resourceSkus = new ResourceSkusClientImpl(this); this.services = new ServicesClientImpl(this); this.tasks = new TasksClientImpl(this); + this.serviceTasks = new ServiceTasksClientImpl(this); this.projects = new ProjectsClientImpl(this); this.usages = new UsagesClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.files = new FilesClientImpl(this); } /** @@ -301,7 +383,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -360,4 +442,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(DataMigrationManagementClientImpl.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java index 1161977596375..081d63d5f0d05 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; import com.azure.resourcemanager.datamigration.models.DataMigrationService; @@ -60,6 +61,10 @@ public ServiceSku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ServiceProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -72,6 +77,18 @@ public String virtualSubnetId() { return this.innerModel().virtualSubnetId(); } + public String virtualNicId() { + return this.innerModel().virtualNicId(); + } + + public String autoStopDelay() { + return this.innerModel().autoStopDelay(); + } + + public Boolean deleteResourcesOnStop() { + return this.innerModel().deleteResourcesOnStop(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -193,15 +210,15 @@ public void stop(Context context) { serviceManager.services().stop(groupName, serviceName, context); } - public NameAvailabilityResponse nestedCheckNameAvailability(NameAvailabilityRequest parameters) { - return serviceManager.services().nestedCheckNameAvailability(groupName, serviceName, parameters); + public NameAvailabilityResponse checkChildrenNameAvailability(NameAvailabilityRequest parameters) { + return serviceManager.services().checkChildrenNameAvailability(groupName, serviceName, parameters); } - public Response nestedCheckNameAvailabilityWithResponse( + public Response checkChildrenNameAvailabilityWithResponse( NameAvailabilityRequest parameters, Context context) { return serviceManager .services() - .nestedCheckNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + .checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, context); } public DataMigrationServiceImpl withRegion(Region location) { @@ -243,4 +260,19 @@ public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { this.innerModel().withVirtualSubnetId(virtualSubnetId); return this; } + + public DataMigrationServiceImpl withVirtualNicId(String virtualNicId) { + this.innerModel().withVirtualNicId(virtualNicId); + return this; + } + + public DataMigrationServiceImpl withAutoStopDelay(String autoStopDelay) { + this.innerModel().withAutoStopDelay(autoStopDelay); + return this; + } + + public DataMigrationServiceImpl withDeleteResourcesOnStop(Boolean deleteResourcesOnStop) { + this.innerModel().withDeleteResourcesOnStop(deleteResourcesOnStop); + return this; + } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java index b1bb0a6723cd4..ada676133a568 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java @@ -25,6 +25,10 @@ public String agentVersion() { return this.innerModel().agentVersion(); } + public Object agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + public String status() { return this.innerModel().status(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java new file mode 100644 index 0000000000000..419968b714c8b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationProperties; + +public final class DatabaseMigrationImpl implements DatabaseMigration { + private DatabaseMigrationInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DatabaseMigrationImpl( + DatabaseMigrationInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationProperties properties() { + return this.innerModel().properties(); + } + + public DatabaseMigrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java new file mode 100644 index 0000000000000..8f5eef1a8f60c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlDb; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationSqlDbImpl + implements DatabaseMigrationSqlDb, DatabaseMigrationSqlDb.Definition, DatabaseMigrationSqlDb.Update { + private DatabaseMigrationSqlDbInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationPropertiesSqlDb properties() { + return this.innerModel().properties(); + } + + public DatabaseMigrationSqlDbInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlDbInstanceName; + + private String targetDbName; + + public DatabaseMigrationSqlDbImpl withExistingServer(String resourceGroupName, String sqlDbInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sqlDbInstanceName = sqlDbInstanceName; + return this; + } + + public DatabaseMigrationSqlDb create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlDb create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlDbImpl( + String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlDbInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlDbImpl update() { + return this; + } + + public DatabaseMigrationSqlDb apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlDb apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlDbImpl( + DatabaseMigrationSqlDbInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlDbInstanceName = Utils.getValueFromIdByName(innerObject.id(), "servers"); + this.targetDbName = Utils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlDb refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .getWithResponse( + resourceGroupName, + sqlDbInstanceName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlDb refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlDbs() + .getWithResponse( + resourceGroupName, sqlDbInstanceName, targetDbName, localMigrationOperationId, localExpand, context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager + .databaseMigrationsSqlDbs() + .cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager + .databaseMigrationsSqlDbs() + .cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlDbImpl withProperties(DatabaseMigrationPropertiesSqlDb properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java new file mode 100644 index 0000000000000..128a7fea27b26 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlMi; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationSqlMiImpl + implements DatabaseMigrationSqlMi, DatabaseMigrationSqlMi.Definition, DatabaseMigrationSqlMi.Update { + private DatabaseMigrationSqlMiInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationPropertiesSqlMi properties() { + return this.innerModel().properties(); + } + + public DatabaseMigrationSqlMiInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String managedInstanceName; + + private String targetDbName; + + public DatabaseMigrationSqlMiImpl withExistingManagedInstance( + String resourceGroupName, String managedInstanceName) { + this.resourceGroupName = resourceGroupName; + this.managedInstanceName = managedInstanceName; + return this; + } + + public DatabaseMigrationSqlMi create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlMi create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlMiImpl( + String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlMiInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlMiImpl update() { + return this; + } + + public DatabaseMigrationSqlMi apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlMi apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlMiImpl( + DatabaseMigrationSqlMiInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.managedInstanceName = Utils.getValueFromIdByName(innerObject.id(), "managedInstances"); + this.targetDbName = Utils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlMi refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .getWithResponse( + resourceGroupName, + managedInstanceName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlMi refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlMis() + .getWithResponse( + resourceGroupName, + managedInstanceName, + targetDbName, + localMigrationOperationId, + localExpand, + context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager + .databaseMigrationsSqlMis() + .cancel(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager + .databaseMigrationsSqlMis() + .cancel(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public void cutover(MigrationOperationInput parameters) { + serviceManager + .databaseMigrationsSqlMis() + .cutover(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cutover(MigrationOperationInput parameters, Context context) { + serviceManager + .databaseMigrationsSqlMis() + .cutover(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlMiImpl withProperties(DatabaseMigrationPropertiesSqlMi properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java new file mode 100644 index 0000000000000..fb88ab6fd138a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlVm; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationSqlVmImpl + implements DatabaseMigrationSqlVm, DatabaseMigrationSqlVm.Definition, DatabaseMigrationSqlVm.Update { + private DatabaseMigrationSqlVmInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationPropertiesSqlVm properties() { + return this.innerModel().properties(); + } + + public DatabaseMigrationSqlVmInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlVirtualMachineName; + + private String targetDbName; + + public DatabaseMigrationSqlVmImpl withExistingSqlVirtualMachine( + String resourceGroupName, String sqlVirtualMachineName) { + this.resourceGroupName = resourceGroupName; + this.sqlVirtualMachineName = sqlVirtualMachineName; + return this; + } + + public DatabaseMigrationSqlVm create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate( + resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlVm create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlVmImpl( + String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlVmInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlVmImpl update() { + return this; + } + + public DatabaseMigrationSqlVm apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate( + resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlVm apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlVmImpl( + DatabaseMigrationSqlVmInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlVirtualMachineName = Utils.getValueFromIdByName(innerObject.id(), "sqlVirtualMachines"); + this.targetDbName = Utils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlVm refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .getWithResponse( + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlVm refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getDatabaseMigrationsSqlVms() + .getWithResponse( + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + localMigrationOperationId, + localExpand, + context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager + .databaseMigrationsSqlVms() + .cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager + .databaseMigrationsSqlVms() + .cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public void cutover(MigrationOperationInput parameters) { + serviceManager + .databaseMigrationsSqlVms() + .cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cutover(MigrationOperationInput parameters, Context context) { + serviceManager + .databaseMigrationsSqlVms() + .cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlVmImpl withProperties(DatabaseMigrationPropertiesSqlVm properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java new file mode 100644 index 0000000000000..75dff80cb4aae --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java @@ -0,0 +1,1343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlDbsClient. */ +public final class DatabaseMigrationsSqlDbsClientImpl implements DatabaseMigrationsSqlDbsClient { + /** The proxy service used to perform REST calls. */ + private final DatabaseMigrationsSqlDbsService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlDbsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlDbsClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy + .create(DatabaseMigrationsSqlDbsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlDbs to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface DatabaseMigrationsSqlDbsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + + "/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, + @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + + "/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlDbInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + + "/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("force") Boolean force, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + + "/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, + Context context); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand) { + return getWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner get(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getAsync(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand).block(); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, context) + .block(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlDbInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlDbInner.class, + DatabaseMigrationSqlDbInner.class, + this.client.getContext()); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlDbInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlDbInner.class, + DatabaseMigrationSqlDbInner.class, + context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner createOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).block(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner createOrUpdate( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + DatabaseMigrationSqlDbInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + force, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + force, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context).getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + deleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final Boolean force = null; + deleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + deleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context).block(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + sqlDbInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).block(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + cancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java new file mode 100644 index 0000000000000..8dddc24bb3efe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlDb; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlDbs; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlDbsImpl implements DatabaseMigrationsSqlDbs { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlDbsImpl.class); + + private final DatabaseMigrationsSqlDbsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlDbsImpl( + DatabaseMigrationsSqlDbsClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DatabaseMigrationSqlDb get(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + DatabaseMigrationSqlDbInner inner = + this.serviceClient().get(resourceGroupName, sqlDbInstanceName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlDbImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabaseMigrationSqlDbImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force) { + this.serviceClient().delete(resourceGroupName, sqlDbInstanceName, targetDbName, force); + } + + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + this.serviceClient().delete(resourceGroupName, sqlDbInstanceName, targetDbName); + } + + public void delete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context) { + this.serviceClient().delete(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + } + + public void cancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + } + + public void cancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + this.serviceClient().cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlDb getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = Utils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse( + resourceGroupName, + sqlDbInstanceName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = Utils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this + .getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = Utils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, sqlDbInstanceName, targetDbName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = Utils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + this.delete(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + } + + private DatabaseMigrationsSqlDbsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlDbImpl define(String name) { + return new DatabaseMigrationSqlDbImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java new file mode 100644 index 0000000000000..cd7cfef0eead7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java @@ -0,0 +1,1332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlMisClient. */ +public final class DatabaseMigrationsSqlMisClientImpl implements DatabaseMigrationsSqlMisClient { + /** The proxy service used to perform REST calls. */ + private final DatabaseMigrationsSqlMisService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlMisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlMisClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy + .create(DatabaseMigrationsSqlMisService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlMis to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface DatabaseMigrationsSqlMisService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql" + + "/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, + @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql" + + "/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlMiInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql" + + "/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql" + + "/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}/cutover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutover( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, + Context context); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand) { + return getWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String managedInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner get(String resourceGroupName, String managedInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getAsync(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand).block(); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, context) + .block(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlMiInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlMiInner.class, + DatabaseMigrationSqlMiInner.class, + this.client.getContext()); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlMiInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlMiInner.class, + DatabaseMigrationSqlMiInner.class, + context); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner createOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + return createOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner createOrUpdate( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + DatabaseMigrationSqlMiInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + cancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .cutover( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .cutover( + this.client.getEndpoint(), + resourceGroupName, + managedInstanceName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + Mono>> mono = + cutoverWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cutoverWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + cutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + cutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java new file mode 100644 index 0000000000000..66b67877f452c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlMi; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlMis; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlMisImpl implements DatabaseMigrationsSqlMis { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlMisImpl.class); + + private final DatabaseMigrationsSqlMisClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlMisImpl( + DatabaseMigrationsSqlMisClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DatabaseMigrationSqlMi get(String resourceGroupName, String managedInstanceName, String targetDbName) { + DatabaseMigrationSqlMiInner inner = + this.serviceClient().get(resourceGroupName, managedInstanceName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlMiImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabaseMigrationSqlMiImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void cancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + this.serviceClient().cancel(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public void cutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + this.serviceClient().cutover(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + this.serviceClient().cutover(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlMi getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String managedInstanceName = Utils.getValueFromIdByName(id, "managedInstances"); + if (managedInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse( + resourceGroupName, + managedInstanceName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String managedInstanceName = Utils.getValueFromIdByName(id, "managedInstances"); + if (managedInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this + .getWithResponse( + resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, context); + } + + private DatabaseMigrationsSqlMisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlMiImpl define(String name) { + return new DatabaseMigrationSqlMiImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java new file mode 100644 index 0000000000000..1593578e06e33 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java @@ -0,0 +1,1366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlVmsClient. */ +public final class DatabaseMigrationsSqlVmsClientImpl implements DatabaseMigrationsSqlVmsClient { + /** The proxy service used to perform REST calls. */ + private final DatabaseMigrationsSqlVmsService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlVmsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlVmsClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy + .create(DatabaseMigrationsSqlVmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlVms to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface DatabaseMigrationsSqlVmsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, + @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlVmInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}/cancel") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine" + + "/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations" + + "/{targetDbName}/cutover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutover( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, + Context context); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + migrationOperationId, + expand, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand) { + return getWithResponseAsync( + resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync( + resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner get( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand).block(); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + return getWithResponseAsync( + resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand, context) + .block(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlVmInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlVmInner.class, + DatabaseMigrationSqlVmInner.class, + this.client.getContext()); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlVmInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DatabaseMigrationSqlVmInner.class, + DatabaseMigrationSqlVmInner.class, + context); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner createOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner createOrUpdate( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + DatabaseMigrationSqlVmInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cancelWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + cancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .cutover( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .cutover( + this.client.getEndpoint(), + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + Mono>> mono = + cutoverWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + cutoverWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + cutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + cutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java new file mode 100644 index 0000000000000..48e63f967654d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlVm; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlVms; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlVmsImpl implements DatabaseMigrationsSqlVms { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlVmsImpl.class); + + private final DatabaseMigrationsSqlVmsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlVmsImpl( + DatabaseMigrationsSqlVmsClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DatabaseMigrationSqlVm get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName) { + DatabaseMigrationSqlVmInner inner = + this.serviceClient().get(resourceGroupName, sqlVirtualMachineName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlVmImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatabaseMigrationSqlVmImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + this.serviceClient().cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context) { + this.serviceClient().cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlVm getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlVirtualMachineName = Utils.getValueFromIdByName(id, "sqlVirtualMachines"); + if (sqlVirtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlVirtualMachines'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse( + resourceGroupName, + sqlVirtualMachineName, + targetDbName, + localMigrationOperationId, + localExpand, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlVirtualMachineName = Utils.getValueFromIdByName(id, "sqlVirtualMachines"); + if (sqlVirtualMachineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlVirtualMachines'.", id))); + } + String targetDbName = Utils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this + .getWithResponse( + resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand, context); + } + + private DatabaseMigrationsSqlVmsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlVmImpl define(String name) { + return new DatabaseMigrationSqlVmImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java new file mode 100644 index 0000000000000..ecb21317046e4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.models.DeleteNode; + +public final class DeleteNodeImpl implements DeleteNode { + private DeleteNodeInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DeleteNodeImpl( + DeleteNodeInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nodeName() { + return this.innerModel().nodeName(); + } + + public String integrationRuntimeName() { + return this.innerModel().integrationRuntimeName(); + } + + public DeleteNodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java new file mode 100644 index 0000000000000..302fc643f24cc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import java.util.Collections; +import java.util.Map; + +public final class FileStorageInfoImpl implements FileStorageInfo { + private FileStorageInfoInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + FileStorageInfoImpl( + FileStorageInfoInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String uri() { + return this.innerModel().uri(); + } + + public Map headers() { + Map inner = this.innerModel().headers(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public FileStorageInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java new file mode 100644 index 0000000000000..fb76aeaff72f9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java @@ -0,0 +1,1559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FilesClient. */ +public final class FilesClientImpl implements FilesClient { + /** The proxy service used to perform REST calls. */ + private final FilesService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of FilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FilesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(FilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientFiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface FilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectFileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectFileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}/read") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> read( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}/readwrite") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> readWrite( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String projectName) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String projectName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String projectName) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String groupName, String serviceName, String projectName, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName, context)); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String projectName, String fileName) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner get(String groupName, String serviceName, String projectName, String fileName) { + return getAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner createOrUpdate( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateAsync(groupName, serviceName, projectName, fileName, parameters).block(); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context) + .block(); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String projectName, String fileName) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String groupName, String serviceName, String projectName, String fileName) { + deleteAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner update( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateAsync(groupName, serviceName, projectName, fileName, parameters).block(); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context).block(); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .read( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .read( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readAsync( + String groupName, String serviceName, String projectName, String fileName) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileStorageInfoInner read(String groupName, String serviceName, String projectName, String fileName) { + return readAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .readWrite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .readWrite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readWriteAsync( + String groupName, String serviceName, String projectName, String fileName) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName) { + return readWriteAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java new file mode 100644 index 0000000000000..aff49cec9f952 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import com.azure.resourcemanager.datamigration.models.Files; +import com.azure.resourcemanager.datamigration.models.ProjectFile; + +public final class FilesImpl implements Files { + private static final ClientLogger LOGGER = new ClientLogger(FilesImpl.class); + + private final FilesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public FilesImpl( + FilesClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName, String projectName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName); + return Utils.mapPage(inner, inner1 -> new ProjectFileImpl(inner1, this.manager())); + } + + public PagedIterable list(String groupName, String serviceName, String projectName, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName, context); + return Utils.mapPage(inner, inner1 -> new ProjectFileImpl(inner1, this.manager())); + } + + public ProjectFile get(String groupName, String serviceName, String projectName, String fileName) { + ProjectFileInner inner = this.serviceClient().get(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new ProjectFileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectFileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String projectName, String fileName) { + this.serviceClient().delete(groupName, serviceName, projectName, fileName); + } + + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo read(String groupName, String serviceName, String projectName, String fileName) { + FileStorageInfoInner inner = this.serviceClient().read(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new FileStorageInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().readWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileStorageInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileStorageInfo readWrite(String groupName, String serviceName, String projectName, String fileName) { + FileStorageInfoInner inner = this.serviceClient().readWrite(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new FileStorageInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().readWriteWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileStorageInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectFile getById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public void deleteById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + this.deleteWithResponse(groupName, serviceName, projectName, fileName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + private FilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public ProjectFileImpl define(String name) { + return new ProjectFileImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java new file mode 100644 index 0000000000000..ff718f1533c07 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.NodeMonitoringData; +import java.util.Collections; +import java.util.List; + +public final class IntegrationRuntimeMonitoringDataImpl implements IntegrationRuntimeMonitoringData { + private IntegrationRuntimeMonitoringDataInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + IntegrationRuntimeMonitoringDataImpl( + IntegrationRuntimeMonitoringDataInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public List nodes() { + List inner = this.innerModel().nodes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IntegrationRuntimeMonitoringDataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java index f7e1baa7a3258..335b17bc4ccc5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java @@ -25,16 +25,13 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperationList; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.datamigration.models.OperationListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -63,7 +60,7 @@ private interface OperationsService { @Get("/providers/Microsoft.DataMigration/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -73,7 +70,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -81,14 +78,15 @@ Mono> listNext( } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -99,7 +97,7 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -112,16 +110,17 @@ private Mono> listSinglePageAsync() { } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -144,55 +143,55 @@ private Mono> listSinglePageAsync(Context c } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -203,10 +202,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -219,7 +219,7 @@ private Mono> listNextSinglePageAsync(Strin final String accept = "application/json"; return FluxUtil .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -239,10 +239,11 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java new file mode 100644 index 0000000000000..042ea651c8b3b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.datamigration.models.OperationOrigin; +import com.azure.resourcemanager.datamigration.models.OperationsDefinition; +import com.azure.resourcemanager.datamigration.models.OperationsDisplayDefinition; +import java.util.Collections; +import java.util.Map; + +public final class OperationsDefinitionImpl implements OperationsDefinition { + private OperationsDefinitionInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + OperationsDefinitionImpl( + OperationsDefinitionInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationsDisplayDefinition display() { + return this.innerModel().display(); + } + + public OperationOrigin origin() { + return this.innerModel().origin(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationsDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java index 27e354b1cdd26..a1e1e35500bd5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java @@ -8,13 +8,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; import com.azure.resourcemanager.datamigration.models.Operations; -import com.azure.resourcemanager.datamigration.models.ServiceOperation; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.models.OperationsDefinition; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; @@ -26,14 +25,14 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java new file mode 100644 index 0000000000000..a61c9ae4b7551 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +public final class ProjectFileImpl implements ProjectFile, ProjectFile.Definition, ProjectFile.Update { + private ProjectFileInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProjectFileProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProjectFileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String groupName; + + private String serviceName; + + private String projectName; + + private String fileName; + + public ProjectFileImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + public ProjectFile create() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .createOrUpdateWithResponse( + groupName, serviceName, projectName, fileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectFile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .createOrUpdateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectFileImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new ProjectFileInner(); + this.serviceManager = serviceManager; + this.fileName = name; + } + + public ProjectFileImpl update() { + return this; + } + + public ProjectFile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .updateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectFile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .updateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectFileImpl( + ProjectFileInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.groupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + this.fileName = Utils.getValueFromIdByName(innerObject.id(), "files"); + } + + public ProjectFile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .getWithResponse(groupName, serviceName, projectName, fileName, Context.NONE) + .getValue(); + return this; + } + + public ProjectFile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .getWithResponse(groupName, serviceName, projectName, fileName, context) + .getValue(); + return this; + } + + public FileStorageInfo read() { + return serviceManager.files().read(groupName, serviceName, projectName, fileName); + } + + public Response readWithResponse(Context context) { + return serviceManager.files().readWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo readWrite() { + return serviceManager.files().readWrite(groupName, serviceName, projectName, fileName); + } + + public Response readWriteWithResponse(Context context) { + return serviceManager.files().readWriteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public ProjectFileImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ProjectFileImpl withProperties(ProjectFileProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java index 7d8fa863da3c0..1ad2ff44b2492 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.datamigration.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; import com.azure.resourcemanager.datamigration.models.ConnectionInfo; import com.azure.resourcemanager.datamigration.models.DatabaseInfo; import com.azure.resourcemanager.datamigration.models.Project; @@ -48,10 +50,22 @@ public Map tags() { } } + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ProjectSourcePlatform sourcePlatform() { return this.innerModel().sourcePlatform(); } + public AzureActiveDirectoryApp azureAuthenticationInfo() { + return this.innerModel().azureAuthenticationInfo(); + } + public ProjectTargetPlatform targetPlatform() { return this.innerModel().targetPlatform(); } @@ -202,11 +216,21 @@ public ProjectImpl withTags(Map tags) { return this; } + public ProjectImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { this.innerModel().withSourcePlatform(sourcePlatform); return this; } + public ProjectImpl withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo) { + this.innerModel().withAzureAuthenticationInfo(azureAuthenticationInfo); + return this; + } + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { this.innerModel().withTargetPlatform(targetPlatform); return this; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java index 21110750efb08..14a9b4ba518df 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.datamigration.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; import com.azure.resourcemanager.datamigration.models.ProjectTask; import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; @@ -35,6 +38,10 @@ public ProjectTaskProperties properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public ProjectTaskInner innerModel() { return this.innerObject; } @@ -149,6 +156,16 @@ public Response cancelWithResponse(Context context) { return serviceManager.tasks().cancelWithResponse(groupName, serviceName, projectName, taskName, context); } + public CommandProperties command(CommandPropertiesInner parameters) { + return serviceManager.tasks().command(groupName, serviceName, projectName, taskName, parameters); + } + + public Response commandWithResponse(CommandPropertiesInner parameters, Context context) { + return serviceManager + .tasks() + .commandWithResponse(groupName, serviceName, projectName, taskName, parameters, context); + } + public ProjectTaskImpl withEtag(String etag) { this.innerModel().withEtag(etag); return this; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java index 19ea4b810e8e3..9b027fd067ad9 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java @@ -29,7 +29,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.ProjectsClient; import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; import com.azure.resourcemanager.datamigration.models.ProjectList; @@ -37,8 +36,6 @@ /** An instance of this class provides access to all the operations defined in ProjectsClient. */ public final class ProjectsClientImpl implements ProjectsClient { - private final ClientLogger logger = new ClientLogger(ProjectsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ProjectsService service; @@ -68,7 +65,7 @@ private interface ProjectsService { + "/{serviceName}/projects") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( + Mono> list( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupName") String groupName, @@ -148,7 +145,7 @@ Mono> update( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( + Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -164,10 +161,11 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String groupName, String serviceName) { + private Mono> listSinglePageAsync(String groupName, String serviceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -191,7 +189,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str .withContext( context -> service - .listByResourceGroup( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -221,10 +219,11 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( + private Mono> listSinglePageAsync( String groupName, String serviceName, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -247,7 +246,7 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -275,13 +274,12 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String groupName, String serviceName) { + private PagedFlux listAsync(String groupName, String serviceName) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(groupName, serviceName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(groupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -294,13 +292,13 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String groupName, String serviceName, Context context) { + private PagedFlux listAsync(String groupName, String serviceName, Context context) { return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(groupName, serviceName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(groupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -312,11 +310,11 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String groupName, String serviceName) { - return new PagedIterable<>(listByResourceGroupAsync(groupName, serviceName)); + public PagedIterable list(String groupName, String serviceName) { + return new PagedIterable<>(listAsync(groupName, serviceName)); } /** @@ -329,11 +327,11 @@ public PagedIterable listByResourceGroup(String groupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String groupName, String serviceName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(groupName, serviceName, context)); + public PagedIterable list(String groupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, context)); } /** @@ -347,7 +345,7 @@ public PagedIterable listByResourceGroup(String groupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -408,7 +406,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -465,7 +463,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -512,7 +510,7 @@ public ProjectInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -530,7 +528,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -584,7 +582,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -634,7 +632,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String groupName, String serviceName, String projectName) { @@ -677,7 +675,7 @@ public ProjectInner get(String groupName, String serviceName, String projectName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -696,7 +694,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -752,7 +750,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -804,7 +802,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -823,7 +821,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String groupName, String serviceName, String projectName) { @@ -861,7 +859,7 @@ public void delete(String groupName, String serviceName, String projectName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -880,7 +878,7 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -941,7 +939,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -998,7 +996,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1044,7 +1042,7 @@ public ProjectInner update(String groupName, String serviceName, String projectN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1059,10 +1057,11 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1074,8 +1073,7 @@ private Mono> listByResourceGroupNextSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1096,10 +1094,11 @@ private Mono> listByResourceGroupNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1112,7 +1111,7 @@ private Mono> listByResourceGroupNextSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .listNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java index af84fa0b01fde..8f3d7f09ca654 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; import com.azure.resourcemanager.datamigration.models.Project; import com.azure.resourcemanager.datamigration.models.Projects; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ProjectsImpl implements Projects { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ProjectsImpl.class); private final ProjectsClient innerClient; @@ -28,13 +27,13 @@ public ProjectsImpl( this.serviceManager = serviceManager; } - public PagedIterable listByResourceGroup(String groupName, String serviceName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(groupName, serviceName); + public PagedIterable list(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName); return Utils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup(String groupName, String serviceName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(groupName, serviceName, context); + public PagedIterable list(String groupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, context); return Utils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); } @@ -76,7 +75,7 @@ public Response deleteWithResponse( public Project getById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -84,14 +83,14 @@ public Project getById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); @@ -102,7 +101,7 @@ public Project getById(String id) { public Response getByIdWithResponse(String id, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -110,14 +109,14 @@ public Response getByIdWithResponse(String id, Context context) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); @@ -128,7 +127,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -136,26 +135,26 @@ public void deleteById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } Boolean localDeleteRunningTasks = null; - this.deleteWithResponse(groupName, serviceName, projectName, localDeleteRunningTasks, Context.NONE).getValue(); + this.deleteWithResponse(groupName, serviceName, projectName, localDeleteRunningTasks, Context.NONE); } public Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -163,14 +162,14 @@ public Response deleteByIdWithResponse(String id, Boolean deleteRunningTas } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java new file mode 100644 index 0000000000000..a5d1e30832122 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; + +public final class RegenAuthKeysImpl implements RegenAuthKeys { + private RegenAuthKeysInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + RegenAuthKeysImpl( + RegenAuthKeysInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String keyName() { + return this.innerModel().keyName(); + } + + public String authKey1() { + return this.innerModel().authKey1(); + } + + public String authKey2() { + return this.innerModel().authKey2(); + } + + public RegenAuthKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java index 013e663a1c2b7..1c111be54f699 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.ResourceSkusClient; import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; import com.azure.resourcemanager.datamigration.models.ResourceSkusResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ public final class ResourceSkusClientImpl implements ResourceSkusClient { - private final ClientLogger logger = new ClientLogger(ResourceSkusClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ResourceSkusService service; @@ -86,7 +83,8 @@ Mono> listSkusNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -132,7 +130,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -173,7 +172,7 @@ private Mono> listSinglePageAsync(Context contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -187,7 +186,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -200,7 +199,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -214,7 +213,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -228,7 +227,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink) { @@ -264,7 +264,8 @@ private Mono> listSkusNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java index bb4457a04a333..3efca10df69d9 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; import com.azure.resourcemanager.datamigration.models.ResourceSku; import com.azure.resourcemanager.datamigration.models.ResourceSkus; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ResourceSkusImpl implements ResourceSkus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkusImpl.class); private final ResourceSkusClient innerClient; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java new file mode 100644 index 0000000000000..7dcbe36e7ec4b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java @@ -0,0 +1,1384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.TaskList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceTasksClient. */ +public final class ServiceTasksClientImpl implements ServiceTasksClient { + /** The proxy service used to perform REST calls. */ + private final ServiceTasksService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ServiceTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTasksClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy.create(ServiceTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientServiceTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface ServiceTasksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("taskType") String taskType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteRunningTasks") Boolean deleteRunningTasks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}/cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String taskType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + taskType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String taskType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + taskType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String taskType) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName) { + final String taskType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String taskType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName) { + final String taskType = null; + return new PagedIterable<>(listAsync(groupName, serviceName, taskType)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String groupName, String serviceName, String taskType, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, taskType, context)); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner createOrUpdate( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateAsync(groupName, serviceName, taskName, parameters).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String taskName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String taskName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String taskName, String expand) { + return getWithResponseAsync(groupName, serviceName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String taskName) { + final String expand = null; + return getWithResponseAsync(groupName, serviceName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner get(String groupName, String serviceName, String taskName) { + final String expand = null; + return getAsync(groupName, serviceName, taskName, expand).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context) { + return getWithResponseAsync(groupName, serviceName, taskName, expand, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String taskName, Boolean deleteRunningTasks) { + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String taskName) { + final Boolean deleteRunningTasks = null; + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String groupName, String serviceName, String taskName) { + final Boolean deleteRunningTasks = null; + deleteAsync(groupName, serviceName, taskName, deleteRunningTasks).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context) { + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return updateAsync(groupName, serviceName, taskName, parameters).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String taskName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String taskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String groupName, String serviceName, String taskName) { + return cancelWithResponseAsync(groupName, serviceName, taskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner cancel(String groupName, String serviceName, String taskName) { + return cancelAsync(groupName, serviceName, taskName).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context) { + return cancelWithResponseAsync(groupName, serviceName, taskName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java new file mode 100644 index 0000000000000..a26604f2c71f0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; + +public final class ServiceTasksImpl implements ServiceTasks { + private static final ClientLogger LOGGER = new ClientLogger(ServiceTasksImpl.class); + + private final ServiceTasksClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ServiceTasksImpl( + ServiceTasksClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(String groupName, String serviceName, String taskType, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, taskType, context); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public ProjectTask createOrUpdate( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + ProjectTaskInner inner = this.serviceClient().createOrUpdate(groupName, serviceName, taskName, parameters); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(groupName, serviceName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectTask get(String groupName, String serviceName, String taskName) { + ProjectTaskInner inner = this.serviceClient().get(groupName, serviceName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, taskName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String taskName) { + this.serviceClient().delete(groupName, serviceName, taskName); + } + + public Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, taskName, deleteRunningTasks, context); + } + + public ProjectTask update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + ProjectTaskInner inner = this.serviceClient().update(groupName, serviceName, taskName, parameters); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + Response inner = + this.serviceClient().updateWithResponse(groupName, serviceName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectTask cancel(String groupName, String serviceName, String taskName) { + ProjectTaskInner inner = this.serviceClient().cancel(groupName, serviceName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context) { + Response inner = + this.serviceClient().cancelWithResponse(groupName, serviceName, taskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java index 4d2909b9be4ce..9d47b51ebae62 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java @@ -31,7 +31,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.datamigration.fluent.ServicesClient; @@ -48,8 +47,6 @@ /** An instance of this class provides access to all the operations defined in ServicesClient. */ public final class ServicesClientImpl implements ServicesClient { - private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServicesService service; @@ -202,7 +199,7 @@ Mono> listSkus( + "/{serviceName}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> nestedCheckNameAvailability( + Mono> checkChildrenNameAvailability( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupName") String groupName, @@ -244,8 +241,8 @@ Mono> list( Mono> checkNameAvailability( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") NameAvailabilityRequest parameters, @HeaderParam("Accept") String accept, Context context); @@ -296,7 +293,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -357,7 +355,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -414,9 +413,9 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> beginCreateOrUpdateAsync( String groupName, String serviceName, DataMigrationServiceInner parameters) { Mono>> mono = createOrUpdateWithResponseAsync(groupName, serviceName, parameters); @@ -427,7 +426,7 @@ private PollerFlux, DataMigrationServiceIn this.client.getHttpPipeline(), DataMigrationServiceInner.class, DataMigrationServiceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -446,9 +445,9 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> beginCreateOrUpdateAsync( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { context = this.client.mergeContext(context); @@ -479,9 +478,9 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters) { return beginCreateOrUpdateAsync(groupName, serviceName, parameters).getSyncPoller(); @@ -503,9 +502,9 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { return beginCreateOrUpdateAsync(groupName, serviceName, parameters, context).getSyncPoller(); @@ -526,7 +525,7 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -552,7 +551,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -618,7 +617,8 @@ public DataMigrationServiceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -667,7 +667,8 @@ private Mono> getByResourceGroupWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -712,7 +713,7 @@ private Mono> getByResourceGroupWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String groupName, String serviceName) { @@ -753,7 +754,7 @@ public DataMigrationServiceInner getByResourceGroup(String groupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -771,7 +772,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -822,7 +823,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -869,15 +870,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String groupName, String serviceName, Boolean deleteRunningTasks) { Mono>> mono = deleteWithResponseAsync(groupName, serviceName, deleteRunningTasks); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -891,9 +893,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String groupName, String serviceName, Boolean deleteRunningTasks, Context context) { context = this.client.mergeContext(context); @@ -914,9 +916,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String groupName, String serviceName, Boolean deleteRunningTasks) { return beginDeleteAsync(groupName, serviceName, deleteRunningTasks).getSyncPoller(); @@ -933,9 +935,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String groupName, String serviceName, Boolean deleteRunningTasks, Context context) { return beginDeleteAsync(groupName, serviceName, deleteRunningTasks, context).getSyncPoller(); @@ -951,7 +953,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks) { @@ -969,7 +971,7 @@ private Mono deleteAsync(String groupName, String serviceName, Boolean del * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String groupName, String serviceName) { @@ -990,7 +992,7 @@ private Mono deleteAsync(String groupName, String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String groupName, String serviceName, Boolean deleteRunningTasks, Context context) { @@ -1059,7 +1061,8 @@ public void delete(String groupName, String serviceName, Boolean deleteRunningTa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1116,7 +1119,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1169,9 +1173,9 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> beginUpdateAsync( String groupName, String serviceName, DataMigrationServiceInner parameters) { Mono>> mono = updateWithResponseAsync(groupName, serviceName, parameters); @@ -1182,7 +1186,7 @@ private PollerFlux, DataMigrationServiceIn this.client.getHttpPipeline(), DataMigrationServiceInner.class, DataMigrationServiceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1197,9 +1201,9 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> beginUpdateAsync( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { context = this.client.mergeContext(context); @@ -1225,9 +1229,9 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters) { return beginUpdateAsync(groupName, serviceName, parameters).getSyncPoller(); @@ -1245,9 +1249,9 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of a Database Migration Service resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginUpdate( String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { return beginUpdateAsync(groupName, serviceName, parameters, context).getSyncPoller(); @@ -1264,7 +1268,7 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1286,7 +1290,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1344,7 +1348,7 @@ public DataMigrationServiceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkStatusWithResponseAsync( @@ -1393,7 +1397,7 @@ private Mono> checkStatusWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkStatusWithResponseAsync( @@ -1438,7 +1442,7 @@ private Mono> checkStatusWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkStatusAsync(String groupName, String serviceName) { @@ -1479,7 +1483,7 @@ public DataMigrationServiceStatusResponseInner checkStatus(String groupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkStatusWithResponse( @@ -1496,7 +1500,7 @@ public Response checkStatusWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync(String groupName, String serviceName) { @@ -1544,7 +1548,7 @@ private Mono>> startWithResponseAsync(String groupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -1589,14 +1593,15 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync(String groupName, String serviceName) { Mono>> mono = startWithResponseAsync(groupName, serviceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1609,9 +1614,9 @@ private PollerFlux, Void> beginStartAsync(String groupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStartAsync(String groupName, String serviceName, Context context) { context = this.client.mergeContext(context); Mono>> mono = startWithResponseAsync(groupName, serviceName, context); @@ -1629,9 +1634,9 @@ private PollerFlux, Void> beginStartAsync(String groupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String groupName, String serviceName) { return beginStartAsync(groupName, serviceName).getSyncPoller(); } @@ -1646,9 +1651,9 @@ public SyncPoller, Void> beginStart(String groupName, String se * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStart(String groupName, String serviceName, Context context) { return beginStartAsync(groupName, serviceName, context).getSyncPoller(); } @@ -1662,7 +1667,7 @@ public SyncPoller, Void> beginStart(String groupName, String se * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String groupName, String serviceName) { @@ -1679,7 +1684,7 @@ private Mono startAsync(String groupName, String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String groupName, String serviceName, Context context) { @@ -1727,7 +1732,7 @@ public void start(String groupName, String serviceName, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync(String groupName, String serviceName) { @@ -1776,7 +1781,7 @@ private Mono>> stopWithResponseAsync(String groupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -1822,14 +1827,15 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync(String groupName, String serviceName) { Mono>> mono = stopWithResponseAsync(groupName, serviceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1843,9 +1849,9 @@ private PollerFlux, Void> beginStopAsync(String groupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginStopAsync(String groupName, String serviceName, Context context) { context = this.client.mergeContext(context); Mono>> mono = stopWithResponseAsync(groupName, serviceName, context); @@ -1864,9 +1870,9 @@ private PollerFlux, Void> beginStopAsync(String groupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String groupName, String serviceName) { return beginStopAsync(groupName, serviceName).getSyncPoller(); } @@ -1882,9 +1888,9 @@ public SyncPoller, Void> beginStop(String groupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginStop(String groupName, String serviceName, Context context) { return beginStopAsync(groupName, serviceName, context).getSyncPoller(); } @@ -1899,7 +1905,7 @@ public SyncPoller, Void> beginStop(String groupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String groupName, String serviceName) { @@ -1917,7 +1923,7 @@ private Mono stopAsync(String groupName, String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String groupName, String serviceName, Context context) { @@ -1966,7 +1972,7 @@ public void stop(String groupName, String serviceName, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusSinglePageAsync( @@ -2024,7 +2030,7 @@ private Mono> listSkusSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusSinglePageAsync( @@ -2078,7 +2084,7 @@ private Mono> listSkusSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSkusAsync(String groupName, String serviceName) { @@ -2096,7 +2102,7 @@ private PagedFlux listSkusAsync(String groupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSkusAsync(String groupName, String serviceName, Context context) { @@ -2114,7 +2120,7 @@ private PagedFlux listSkusAsync(String groupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSkus(String groupName, String serviceName) { @@ -2131,7 +2137,7 @@ public PagedIterable listSkus(String groupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSkus(String groupName, String serviceName, Context context) { @@ -2147,10 +2153,11 @@ public PagedIterable listSkus(String groupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> nestedCheckNameAvailabilityWithResponseAsync( + private Mono> checkChildrenNameAvailabilityWithResponseAsync( String groupName, String serviceName, NameAvailabilityRequest parameters) { if (this.client.getEndpoint() == null) { return Mono @@ -2180,7 +2187,7 @@ private Mono> nestedCheckNameAvailabilit .withContext( context -> service - .nestedCheckNameAvailability( + .checkChildrenNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -2202,10 +2209,11 @@ private Mono> nestedCheckNameAvailabilit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> nestedCheckNameAvailabilityWithResponseAsync( + private Mono> checkChildrenNameAvailabilityWithResponseAsync( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2233,7 +2241,7 @@ private Mono> nestedCheckNameAvailabilit final String accept = "application/json"; context = this.client.mergeContext(context); return service - .nestedCheckNameAvailability( + .checkChildrenNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -2253,12 +2261,12 @@ private Mono> nestedCheckNameAvailabilit * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono nestedCheckNameAvailabilityAsync( + private Mono checkChildrenNameAvailabilityAsync( String groupName, String serviceName, NameAvailabilityRequest parameters) { - return nestedCheckNameAvailabilityWithResponseAsync(groupName, serviceName, parameters) + return checkChildrenNameAvailabilityWithResponseAsync(groupName, serviceName, parameters) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -2281,9 +2289,9 @@ private Mono nestedCheckNameAvailabilityAsync( * @return indicates whether a proposed resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityResponseInner nestedCheckNameAvailability( + public NameAvailabilityResponseInner checkChildrenNameAvailability( String groupName, String serviceName, NameAvailabilityRequest parameters) { - return nestedCheckNameAvailabilityAsync(groupName, serviceName, parameters).block(); + return checkChildrenNameAvailabilityAsync(groupName, serviceName, parameters).block(); } /** @@ -2296,12 +2304,12 @@ public NameAvailabilityResponseInner nestedCheckNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response nestedCheckNameAvailabilityWithResponse( + public Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { - return nestedCheckNameAvailabilityWithResponseAsync(groupName, serviceName, parameters, context).block(); + return checkChildrenNameAvailabilityWithResponseAsync(groupName, serviceName, parameters, context).block(); } /** @@ -2312,7 +2320,7 @@ public Response nestedCheckNameAvailabilityWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String groupName) { @@ -2364,7 +2372,7 @@ private Mono> listByResourceGroupSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -2413,7 +2421,7 @@ private Mono> listByResourceGroupSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String groupName) { @@ -2431,7 +2439,7 @@ private PagedFlux listByResourceGroupAsync(String gro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String groupName, Context context) { @@ -2448,7 +2456,7 @@ private PagedFlux listByResourceGroupAsync(String gro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String groupName) { @@ -2464,7 +2472,7 @@ public PagedIterable listByResourceGroup(String group * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String groupName, Context context) { @@ -2477,7 +2485,7 @@ public PagedIterable listByResourceGroup(String group * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -2524,7 +2532,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -2566,7 +2574,7 @@ private Mono> listSinglePageAsync(Conte * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -2581,7 +2589,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -2595,7 +2603,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -2610,7 +2618,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -2625,7 +2633,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -2658,8 +2667,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, context)) @@ -2675,7 +2684,8 @@ private Mono> checkNameAvailabilityWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -2706,8 +2716,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, context); @@ -2721,7 +2731,7 @@ private Mono> checkNameAvailabilityWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -2761,7 +2771,7 @@ public NameAvailabilityResponseInner checkNameAvailability(String location, Name * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -2776,7 +2786,7 @@ public Response checkNameAvailabilityWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink) { @@ -2812,7 +2822,7 @@ private Mono> listSkusNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync( @@ -2848,7 +2858,7 @@ private Mono> listSkusNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2885,7 +2895,7 @@ private Mono> listByResourceGroupNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -2921,7 +2931,7 @@ private Mono> listByResourceGroupNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2957,7 +2967,7 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java index 458bd7e263930..fb8b7409a09b4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java @@ -20,10 +20,9 @@ import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; import com.azure.resourcemanager.datamigration.models.Services; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ServicesImpl implements Services { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); private final ServicesClient innerClient; @@ -121,10 +120,10 @@ public PagedIterable listSkus(String groupName, String serv return Utils.mapPage(inner, inner1 -> new AvailableServiceSkuImpl(inner1, this.manager())); } - public NameAvailabilityResponse nestedCheckNameAvailability( + public NameAvailabilityResponse checkChildrenNameAvailability( String groupName, String serviceName, NameAvailabilityRequest parameters) { NameAvailabilityResponseInner inner = - this.serviceClient().nestedCheckNameAvailability(groupName, serviceName, parameters); + this.serviceClient().checkChildrenNameAvailability(groupName, serviceName, parameters); if (inner != null) { return new NameAvailabilityResponseImpl(inner, this.manager()); } else { @@ -132,10 +131,10 @@ public NameAvailabilityResponse nestedCheckNameAvailability( } } - public Response nestedCheckNameAvailabilityWithResponse( + public Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { Response inner = - this.serviceClient().nestedCheckNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + this.serviceClient().checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), @@ -194,7 +193,7 @@ public Response checkNameAvailabilityWithResponse( public DataMigrationService getById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -202,7 +201,7 @@ public DataMigrationService getById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); @@ -213,7 +212,7 @@ public DataMigrationService getById(String id) { public Response getByIdWithResponse(String id, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -221,7 +220,7 @@ public Response getByIdWithResponse(String id, Context con } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); @@ -232,7 +231,7 @@ public Response getByIdWithResponse(String id, Context con public void deleteById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -240,7 +239,7 @@ public void deleteById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); @@ -252,7 +251,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -260,7 +259,7 @@ public void deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Contex } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java new file mode 100644 index 0000000000000..780170ebf286a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; +import com.azure.resourcemanager.datamigration.models.DeleteNode; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; +import java.util.Collections; +import java.util.Map; + +public final class SqlMigrationServiceImpl + implements SqlMigrationService, SqlMigrationService.Definition, SqlMigrationService.Update { + private SqlMigrationServiceInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String integrationRuntimeState() { + return this.innerModel().integrationRuntimeState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SqlMigrationServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlMigrationServiceName; + + private SqlMigrationServiceUpdate updateParameters; + + public SqlMigrationServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SqlMigrationService create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .createOrUpdate(resourceGroupName, sqlMigrationServiceName, this.innerModel(), Context.NONE); + return this; + } + + public SqlMigrationService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .createOrUpdate(resourceGroupName, sqlMigrationServiceName, this.innerModel(), context); + return this; + } + + SqlMigrationServiceImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new SqlMigrationServiceInner(); + this.serviceManager = serviceManager; + this.sqlMigrationServiceName = name; + } + + public SqlMigrationServiceImpl update() { + this.updateParameters = new SqlMigrationServiceUpdate(); + return this; + } + + public SqlMigrationService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .update(resourceGroupName, sqlMigrationServiceName, updateParameters, Context.NONE); + return this; + } + + public SqlMigrationService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .update(resourceGroupName, sqlMigrationServiceName, updateParameters, context); + return this; + } + + SqlMigrationServiceImpl( + SqlMigrationServiceInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlMigrationServiceName = Utils.getValueFromIdByName(innerObject.id(), "sqlMigrationServices"); + } + + public SqlMigrationService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE) + .getValue(); + return this; + } + + public SqlMigrationService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context) + .getValue(); + return this; + } + + public AuthenticationKeys listAuthKeys() { + return serviceManager.sqlMigrationServices().listAuthKeys(resourceGroupName, sqlMigrationServiceName); + } + + public Response listAuthKeysWithResponse(Context context) { + return serviceManager + .sqlMigrationServices() + .listAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public RegenAuthKeys regenerateAuthKeys(RegenAuthKeysInner parameters) { + return serviceManager + .sqlMigrationServices() + .regenerateAuthKeys(resourceGroupName, sqlMigrationServiceName, parameters); + } + + public Response regenerateAuthKeysWithResponse(RegenAuthKeysInner parameters, Context context) { + return serviceManager + .sqlMigrationServices() + .regenerateAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + } + + public DeleteNode deleteNode(DeleteNodeInner parameters) { + return serviceManager.sqlMigrationServices().deleteNode(resourceGroupName, sqlMigrationServiceName, parameters); + } + + public Response deleteNodeWithResponse(DeleteNodeInner parameters, Context context) { + return serviceManager + .sqlMigrationServices() + .deleteNodeWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + } + + public IntegrationRuntimeMonitoringData listMonitoringData() { + return serviceManager.sqlMigrationServices().listMonitoringData(resourceGroupName, sqlMigrationServiceName); + } + + public Response listMonitoringDataWithResponse(Context context) { + return serviceManager + .sqlMigrationServices() + .listMonitoringDataWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public SqlMigrationServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlMigrationServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlMigrationServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java new file mode 100644 index 0000000000000..df8cd35868c47 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java @@ -0,0 +1,2678 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationListResult; +import com.azure.resourcemanager.datamigration.models.SqlMigrationListResult; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlMigrationServicesClient. */ +public final class SqlMigrationServicesClientImpl implements SqlMigrationServicesClient { + /** The proxy service used to perform REST calls. */ + private final SqlMigrationServicesService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of SqlMigrationServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlMigrationServicesClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy + .create(SqlMigrationServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientSqlMigrationServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface SqlMigrationServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlMigrationServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlMigrationServiceUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateAuthKeys( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegenAuthKeysInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteNode( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeleteNodeInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrations( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration" + + "/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMonitoringData( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String sqlMigrationServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + return getByResourceGroupAsync(resourceGroupName, sqlMigrationServiceName).block(); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlMigrationServiceInner.class, + SqlMigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlMigrationServiceInner.class, + SqlMigrationServiceInner.class, + context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner createOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner createOrUpdate( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlMigrationServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlMigrationServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName, context).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlMigrationServiceName) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlMigrationServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlMigrationServiceName) { + deleteAsync(resourceGroupName, sqlMigrationServiceName).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlMigrationServiceName, Context context) { + deleteAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlMigrationServiceInner.class, + SqlMigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginUpdateAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SqlMigrationServiceInner.class, + SqlMigrationServiceInner.class, + context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginUpdate( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner update( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + return updateAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner update( + String resourceGroupName, + String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthKeysWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAuthKeys( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthKeysWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAuthKeys( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAuthKeysAsync(String resourceGroupName, String sqlMigrationServiceName) { + return listAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthenticationKeysInner listAuthKeys(String resourceGroupName, String sqlMigrationServiceName) { + return listAuthKeysAsync(resourceGroupName, sqlMigrationServiceName).block(); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return listAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateAuthKeysWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateAuthKeys( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateAuthKeysWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateAuthKeys( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateAuthKeysAsync( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters) { + return regenerateAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegenAuthKeysInner regenerateAuthKeys( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters) { + return regenerateAuthKeysAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + return regenerateAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .block(); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNodeWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNode( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNodeWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNode( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters) { + return deleteNodeWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeleteNodeInner deleteNode( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters) { + return deleteNodeAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNodeWithResponse( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters, Context context) { + return deleteNodeWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync( + String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listMigrations( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMigrations( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync( + String resourceGroupName, String sqlMigrationServiceName) { + return new PagedFlux<>( + () -> listMigrationsSinglePageAsync(resourceGroupName, sqlMigrationServiceName), + nextLink -> listMigrationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return new PagedFlux<>( + () -> listMigrationsSinglePageAsync(resourceGroupName, sqlMigrationServiceName, context), + nextLink -> listMigrationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations( + String resourceGroupName, String sqlMigrationServiceName) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, sqlMigrationServiceName)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, sqlMigrationServiceName, context)); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoringDataWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listMonitoringData( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoringDataWithResponseAsync( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMonitoringData( + this.client.getEndpoint(), + resourceGroupName, + sqlMigrationServiceName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listMonitoringDataAsync( + String resourceGroupName, String sqlMigrationServiceName) { + return listMonitoringDataWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeMonitoringDataInner listMonitoringData( + String resourceGroupName, String sqlMigrationServiceName) { + return listMonitoringDataAsync(resourceGroupName, sqlMigrationServiceName).block(); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listMonitoringDataWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + return listMonitoringDataWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java new file mode 100644 index 0000000000000..1a26ecf6261bc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; +import com.azure.resourcemanager.datamigration.models.DatabaseMigration; +import com.azure.resourcemanager.datamigration.models.DeleteNode; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServices; + +public final class SqlMigrationServicesImpl implements SqlMigrationServices { + private static final ClientLogger LOGGER = new ClientLogger(SqlMigrationServicesImpl.class); + + private final SqlMigrationServicesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public SqlMigrationServicesImpl( + SqlMigrationServicesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlMigrationService getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + SqlMigrationServiceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new SqlMigrationServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlMigrationServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + this.serviceClient().delete(resourceGroupName, sqlMigrationServiceName); + } + + public void delete(String resourceGroupName, String sqlMigrationServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, sqlMigrationServiceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public AuthenticationKeys listAuthKeys(String resourceGroupName, String sqlMigrationServiceName) { + AuthenticationKeysInner inner = this.serviceClient().listAuthKeys(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new AuthenticationKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + Response inner = + this.serviceClient().listAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthenticationKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegenAuthKeys regenerateAuthKeys( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters) { + RegenAuthKeysInner inner = + this.serviceClient().regenerateAuthKeys(resourceGroupName, sqlMigrationServiceName, parameters); + if (inner != null) { + return new RegenAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + Response inner = + this + .serviceClient() + .regenerateAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegenAuthKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeleteNode deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters) { + DeleteNodeInner inner = this.serviceClient().deleteNode(resourceGroupName, sqlMigrationServiceName, parameters); + if (inner != null) { + return new DeleteNodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteNodeWithResponse( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters, Context context) { + Response inner = + this + .serviceClient() + .deleteNodeWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeleteNodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName) { + PagedIterable inner = + this.serviceClient().listMigrations(resourceGroupName, sqlMigrationServiceName); + return Utils.mapPage(inner, inner1 -> new DatabaseMigrationImpl(inner1, this.manager())); + } + + public PagedIterable listMigrations( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listMigrations(resourceGroupName, sqlMigrationServiceName, context); + return Utils.mapPage(inner, inner1 -> new DatabaseMigrationImpl(inner1, this.manager())); + } + + public IntegrationRuntimeMonitoringData listMonitoringData( + String resourceGroupName, String sqlMigrationServiceName) { + IntegrationRuntimeMonitoringDataInner inner = + this.serviceClient().listMonitoringData(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new IntegrationRuntimeMonitoringDataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listMonitoringDataWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context) { + Response inner = + this.serviceClient().listMonitoringDataWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeMonitoringDataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public SqlMigrationService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = Utils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = Utils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = Utils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", + id))); + } + this.delete(resourceGroupName, sqlMigrationServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = Utils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", + id))); + } + this.delete(resourceGroupName, sqlMigrationServiceName, context); + } + + private SqlMigrationServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public SqlMigrationServiceImpl define(String name) { + return new SqlMigrationServiceImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java index 89cfc26d5db04..d456b30455d6b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java @@ -30,16 +30,14 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.TasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; import com.azure.resourcemanager.datamigration.models.TaskList; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in TasksClient. */ public final class TasksClientImpl implements TasksClient { - private final ClientLogger logger = new ClientLogger(TasksClientImpl.class); - /** The proxy service used to perform REST calls. */ private final TasksService service; @@ -169,6 +167,24 @@ Mono> cancel( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}/command") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> command( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CommandPropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -192,7 +208,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -258,7 +274,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -320,7 +336,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -341,7 +357,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String groupName, String serviceName, String projectName) { @@ -364,7 +380,7 @@ private PagedFlux listAsync(String groupName, String serviceNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -385,7 +401,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String groupName, String serviceName, String projectName) { @@ -406,7 +422,7 @@ public PagedIterable list(String groupName, String serviceName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -427,7 +443,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -494,7 +510,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -562,7 +578,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -613,7 +629,7 @@ public ProjectTaskInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -639,7 +655,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -700,7 +716,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -757,7 +773,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -784,7 +800,7 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String groupName, String serviceName, String projectName, String taskName) { @@ -832,7 +848,7 @@ public ProjectTaskInner get(String groupName, String serviceName, String project * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -852,7 +868,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -913,7 +929,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -975,7 +991,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -995,7 +1011,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String groupName, String serviceName, String projectName, String taskName) { @@ -1035,7 +1051,7 @@ public void delete(String groupName, String serviceName, String projectName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1062,7 +1078,7 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1129,7 +1145,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -1197,7 +1213,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1248,7 +1264,7 @@ public ProjectTaskInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -1272,7 +1288,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync( @@ -1331,7 +1347,7 @@ private Mono> cancelWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> cancelWithResponseAsync( @@ -1386,7 +1402,7 @@ private Mono> cancelWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono cancelAsync( @@ -1432,7 +1448,7 @@ public ProjectTaskInner cancel(String groupName, String serviceName, String proj * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelWithResponse( @@ -1440,6 +1456,215 @@ public Response cancelWithResponse( return cancelWithResponseAsync(groupName, serviceName, projectName, taskName, context).block(); } + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .command( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .command( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commandAsync( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommandPropertiesInner command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandAsync(groupName, serviceName, projectName, taskName, parameters).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, parameters, context).block(); + } + /** * Get the next page of items. * @@ -1447,7 +1672,7 @@ public Response cancelWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1483,7 +1708,7 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java index 1159d74feedcc..32fd91265a87f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java @@ -10,13 +10,14 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.TasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; import com.azure.resourcemanager.datamigration.models.ProjectTask; import com.azure.resourcemanager.datamigration.models.Tasks; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class TasksImpl implements Tasks { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TasksImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(TasksImpl.class); private final TasksClient innerClient; @@ -104,10 +105,43 @@ public Response cancelWithResponse( } } + public CommandProperties command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + CommandPropertiesInner inner = + this.serviceClient().command(groupName, serviceName, projectName, taskName, parameters); + if (inner != null) { + return new CommandPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .commandWithResponse(groupName, serviceName, projectName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommandPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public ProjectTask getById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,21 +149,21 @@ public ProjectTask getById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } String taskName = Utils.getValueFromIdByName(id, "tasks"); if (taskName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); @@ -143,7 +177,7 @@ public ProjectTask getById(String id) { public Response getByIdWithResponse(String id, String expand, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -151,21 +185,21 @@ public Response getByIdWithResponse(String id, String expand, Conte } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } String taskName = Utils.getValueFromIdByName(id, "tasks"); if (taskName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); @@ -176,7 +210,7 @@ public Response getByIdWithResponse(String id, String expand, Conte public void deleteById(String id) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -184,35 +218,33 @@ public void deleteById(String id) { } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } String taskName = Utils.getValueFromIdByName(id, "tasks"); if (taskName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); } Boolean localDeleteRunningTasks = null; - this - .deleteWithResponse(groupName, serviceName, projectName, taskName, localDeleteRunningTasks, Context.NONE) - .getValue(); + this.deleteWithResponse(groupName, serviceName, projectName, taskName, localDeleteRunningTasks, Context.NONE); } public Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -220,21 +252,21 @@ public Response deleteByIdWithResponse(String id, Boolean deleteRunningTas } String serviceName = Utils.getValueFromIdByName(id, "services"); if (serviceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); } String projectName = Utils.getValueFromIdByName(id, "projects"); if (projectName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } String taskName = Utils.getValueFromIdByName(id, "tasks"); if (taskName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java index 241d2b74ea5de..e3563287c50a0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.UsagesClient; import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; import com.azure.resourcemanager.datamigration.models.QuotaList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in UsagesClient. */ public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final UsagesService service; @@ -88,7 +85,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { @@ -139,7 +136,7 @@ private Mono> listSinglePageAsync(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location, Context context) { @@ -186,7 +183,7 @@ private Mono> listSinglePageAsync(String location, Con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location) { @@ -201,7 +198,7 @@ private PagedFlux listAsync(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, Context context) { @@ -216,7 +213,7 @@ private PagedFlux listAsync(String location, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { @@ -231,7 +228,7 @@ public PagedIterable list(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { @@ -245,7 +242,7 @@ public PagedIterable list(String location, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -281,7 +278,7 @@ private Mono> listNextSinglePageAsync(String nextLink) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java index e81cd59996cb9..5a188b8bdf8db 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; import com.azure.resourcemanager.datamigration.models.Quota; import com.azure.resourcemanager.datamigration.models.Usages; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class UsagesImpl implements Usages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); private final UsagesClient innerClient; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java new file mode 100644 index 0000000000000..1623692a49d47 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; + +/** An immutable client-side representation of AuthenticationKeys. */ +public interface AuthenticationKeys { + /** + * Gets the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + String authKey1(); + + /** + * Gets the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + String authKey2(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner object. + * + * @return the inner object. + */ + AuthenticationKeysInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java index ee7fa4c38bcb7..de45ae6072af8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java @@ -20,7 +20,7 @@ public interface AvailableServiceSku { * * @return the sku value. */ - AvailableServiceSkuAutoGenerated sku(); + AvailableServiceSkuSku sku(); /** * Gets the capacity property: A description of the scaling capacities of the SKU. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java index 01a8804f52aa4..927834538d391 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A description of the scaling capacities of the SKU. */ @Fluent public final class AvailableServiceSkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuCapacity.class); - /* * The minimum capacity, usually 0 or 1. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java similarity index 65% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java index eee7d0547d2aa..47308eb0b4d60 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** SKU name, tier, etc. */ @Fluent -public final class AvailableServiceSkuAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuAutoGenerated.class); - +public final class AvailableServiceSkuSku { /* * The name of the SKU */ @@ -33,7 +29,8 @@ public final class AvailableServiceSkuAutoGenerated { private String size; /* - * The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium" + * The tier of the SKU, such as "Basic", "General Purpose", or "Business + * Critical" */ @JsonProperty(value = "tier") private String tier; @@ -51,9 +48,9 @@ public String name() { * Set the name property: The name of the SKU. * * @param name the name value to set. - * @return the AvailableServiceSkuAutoGenerated object itself. + * @return the AvailableServiceSkuSku object itself. */ - public AvailableServiceSkuAutoGenerated withName(String name) { + public AvailableServiceSkuSku withName(String name) { this.name = name; return this; } @@ -71,9 +68,9 @@ public String family() { * Set the family property: SKU family. * * @param family the family value to set. - * @return the AvailableServiceSkuAutoGenerated object itself. + * @return the AvailableServiceSkuSku object itself. */ - public AvailableServiceSkuAutoGenerated withFamily(String family) { + public AvailableServiceSkuSku withFamily(String family) { this.family = family; return this; } @@ -91,15 +88,15 @@ public String size() { * Set the size property: SKU size. * * @param size the size value to set. - * @return the AvailableServiceSkuAutoGenerated object itself. + * @return the AvailableServiceSkuSku object itself. */ - public AvailableServiceSkuAutoGenerated withSize(String size) { + public AvailableServiceSkuSku withSize(String size) { this.size = size; return this; } /** - * Get the tier property: The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * Get the tier property: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". * * @return the tier value. */ @@ -108,12 +105,12 @@ public String tier() { } /** - * Set the tier property: The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium". + * Set the tier property: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". * * @param tier the tier value to set. - * @return the AvailableServiceSkuAutoGenerated object itself. + * @return the AvailableServiceSkuSku object itself. */ - public AvailableServiceSkuAutoGenerated withTier(String tier) { + public AvailableServiceSkuSku withTier(String tier) { this.tier = tier; return this; } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java index 970016812bc60..35c0125701af6 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java @@ -5,33 +5,35 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Azure Active Directory Application. */ @Fluent public final class AzureActiveDirectoryApp { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectoryApp.class); - /* * Application ID of the Azure Active Directory Application */ - @JsonProperty(value = "applicationId", required = true) + @JsonProperty(value = "applicationId") private String applicationId; /* * Key used to authenticate to the Azure Active Directory Application */ - @JsonProperty(value = "appKey", required = true) + @JsonProperty(value = "appKey") private String appKey; /* * Tenant id of the customer */ - @JsonProperty(value = "tenantId", required = true) + @JsonProperty(value = "tenantId") private String tenantId; + /* + * Ignore checking azure permissions on the AAD app + */ + @JsonProperty(value = "ignoreAzurePermissions") + private Boolean ignoreAzurePermissions; + /** * Get the applicationId property: Application ID of the Azure Active Directory Application. * @@ -92,28 +94,31 @@ public AzureActiveDirectoryApp withTenantId(String tenantId) { return this; } + /** + * Get the ignoreAzurePermissions property: Ignore checking azure permissions on the AAD app. + * + * @return the ignoreAzurePermissions value. + */ + public Boolean ignoreAzurePermissions() { + return this.ignoreAzurePermissions; + } + + /** + * Set the ignoreAzurePermissions property: Ignore checking azure permissions on the AAD app. + * + * @param ignoreAzurePermissions the ignoreAzurePermissions value to set. + * @return the AzureActiveDirectoryApp object itself. + */ + public AzureActiveDirectoryApp withIgnoreAzurePermissions(Boolean ignoreAzurePermissions) { + this.ignoreAzurePermissions = ignoreAzurePermissions; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (applicationId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property applicationId in model AzureActiveDirectoryApp")); - } - if (appKey() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property appKey in model AzureActiveDirectoryApp")); - } - if (tenantId() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property tenantId in model AzureActiveDirectoryApp")); - } } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.java new file mode 100644 index 0000000000000..7e55d35ace3ba --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Blob Details. */ +@Fluent +public final class AzureBlob { + /* + * Resource Id of the storage account where backups are stored. + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Storage Account Key. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /* + * Blob container name where backups are stored. + */ + @JsonProperty(value = "blobContainerName") + private String blobContainerName; + + /** + * Get the storageAccountResourceId property: Resource Id of the storage account where backups are stored. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Resource Id of the storage account where backups are stored. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the accountKey property: Storage Account Key. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage Account Key. + * + * @param accountKey the accountKey value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the blobContainerName property: Blob container name where backups are stored. + * + * @return the blobContainerName value. + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Set the blobContainerName property: Blob container name where backups are stored. + * + * @param blobContainerName the blobContainerName value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withBlobContainerName(String blobContainerName) { + this.blobContainerName = blobContainerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java new file mode 100644 index 0000000000000..b48edc896c42c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup Configuration. */ +@Fluent +public final class BackupConfiguration { + /* + * Source location of backups. + */ + @JsonProperty(value = "sourceLocation") + private SourceLocation sourceLocation; + + /* + * Target location for copying backups. + */ + @JsonProperty(value = "targetLocation") + private TargetLocation targetLocation; + + /** + * Get the sourceLocation property: Source location of backups. + * + * @return the sourceLocation value. + */ + public SourceLocation sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation property: Source location of backups. + * + * @param sourceLocation the sourceLocation value to set. + * @return the BackupConfiguration object itself. + */ + public BackupConfiguration withSourceLocation(SourceLocation sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the targetLocation property: Target location for copying backups. + * + * @return the targetLocation value. + */ + public TargetLocation targetLocation() { + return this.targetLocation; + } + + /** + * Set the targetLocation property: Target location for copying backups. + * + * @param targetLocation the targetLocation value to set. + * @return the BackupConfiguration object itself. + */ + public BackupConfiguration withTargetLocation(TargetLocation targetLocation) { + this.targetLocation = targetLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceLocation() != null) { + sourceLocation().validate(); + } + if (targetLocation() != null) { + targetLocation().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java index 5b2de5f3054f4..6024ae75fee31 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Information of the backup file. */ @Fluent public final class BackupFileInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupFileInfo.class); - /* * Location of the backup file in shared folder */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java index 3d9528611ff58..ef57f4f1924d4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -14,8 +12,6 @@ /** Information of backup set. */ @Fluent public final class BackupSetInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupSetInfo.class); - /* * Id for the set of backup files */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java index 27bdabe45418c..9f4429857c6f2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java @@ -5,19 +5,15 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Blob container storage information. */ @Fluent public final class BlobShare { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobShare.class); - /* * SAS URI of Azure Storage Account Container. */ - @JsonProperty(value = "sasUri", required = true) + @JsonProperty(value = "sasUri") private String sasUri; /** @@ -46,10 +42,5 @@ public BlobShare withSasUri(String sasUri) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sasUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property sasUri in model BlobShare")); - } } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java new file mode 100644 index 0000000000000..fbabe4ee8ece9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to check for OCI drivers. */ +@Fluent +public final class CheckOciDriverTaskInput { + /* + * Version of the source server to check against. Optional. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** + * Get the serverVersion property: Version of the source server to check against. Optional. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: Version of the source server to check against. Optional. + * + * @param serverVersion the serverVersion value to set. + * @return the CheckOciDriverTaskInput object itself. + */ + public CheckOciDriverTaskInput withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java new file mode 100644 index 0000000000000..77859f1d8d91e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the service task to check for OCI drivers. */ +@Fluent +public final class CheckOciDriverTaskOutput { + /* + * Information about the installed driver if found and valid. + */ + @JsonProperty(value = "installedDriver") + private OracleOciDriverInfo installedDriver; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the installedDriver property: Information about the installed driver if found and valid. + * + * @return the installedDriver value. + */ + public OracleOciDriverInfo installedDriver() { + return this.installedDriver; + } + + /** + * Set the installedDriver property: Information about the installed driver if found and valid. + * + * @param installedDriver the installedDriver value to set. + * @return the CheckOciDriverTaskOutput object itself. + */ + public CheckOciDriverTaskOutput withInstalledDriver(OracleOciDriverInfo installedDriver) { + this.installedDriver = installedDriver; + return this; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (installedDriver() != null) { + installedDriver().validate(); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java new file mode 100644 index 0000000000000..9122c7f50ceb3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that checks for OCI drivers. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Check.OCI") +@Fluent +public final class CheckOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Input for the service task to check for OCI drivers. + */ + @JsonProperty(value = "input") + private CheckOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to check for OCI drivers. + * + * @return the input value. + */ + public CheckOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to check for OCI drivers. + * + * @param input the input value to set. + * @return the CheckOciDriverTaskProperties object itself. + */ + public CheckOciDriverTaskProperties withInput(CheckOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public CheckOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java index 4a0f9cb1173b3..8912a2125c40d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java @@ -4,71 +4,30 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.util.List; -/** - * Base class for all types of DMS command properties. If command is not supported by current client, this object is - * returned. - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "commandType", - defaultImpl = CommandProperties.class) -@JsonTypeName("CommandProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), - @JsonSubTypes.Type( - name = "Migrate.SqlServer.AzureDbSqlMi.Complete", - value = MigrateMISyncCompleteCommandProperties.class) -}) -@Immutable -public class CommandProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CommandProperties.class); - - /* - * Array of errors. This is ignored if submitted. - */ - @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) - private List errors; - - /* - * The state of the command. This is ignored if submitted. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private CommandState state; - +/** An immutable client-side representation of CommandProperties. */ +public interface CommandProperties { /** - * Get the errors property: Array of errors. This is ignored if submitted. + * Gets the errors property: Array of errors. This is ignored if submitted. * * @return the errors value. */ - public List errors() { - return this.errors; - } + List errors(); /** - * Get the state property: The state of the command. This is ignored if submitted. + * Gets the state property: The state of the command. This is ignored if submitted. * * @return the state value. */ - public CommandState state() { - return this.state; - } + CommandState state(); /** - * Validates the instance. + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner object. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the inner object. */ - public void validate() { - } + CommandPropertiesInner innerModel(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java new file mode 100644 index 0000000000000..a4fd36d56bc56 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CommandType. */ +public final class CommandType extends ExpandableStringEnum { + /** Static value Migrate.Sync.Complete.Database for CommandType. */ + public static final CommandType MIGRATE_SYNC_COMPLETE_DATABASE = fromString("Migrate.Sync.Complete.Database"); + + /** Static value Migrate.SqlServer.AzureDbSqlMi.Complete for CommandType. */ + public static final CommandType MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE = + fromString("Migrate.SqlServer.AzureDbSqlMi.Complete"); + + /** Static value cancel for CommandType. */ + public static final CommandType CANCEL = fromString("cancel"); + + /** Static value finish for CommandType. */ + public static final CommandType FINISH = fromString("finish"); + + /** Static value restart for CommandType. */ + public static final CommandType RESTART = fromString("restart"); + + /** + * Creates or finds a CommandType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommandType. + */ + @JsonCreator + public static CommandType fromString(String name) { + return fromString(name, CommandType.class); + } + + /** @return known CommandType values. */ + public static Collection values() { + return values(CommandType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java new file mode 100644 index 0000000000000..bf8059efceeb8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates the connection to and provides information about a MongoDB server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Connect.MongoDb") +@Fluent +public final class ConnectToMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Describes a connection to a MongoDB data source + */ + @JsonProperty(value = "input") + private MongoDbConnectionInfo input; + + /* + * An array containing a single MongoDbClusterInfo object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes a connection to a MongoDB data source. + * + * @return the input value. + */ + public MongoDbConnectionInfo input() { + return this.input; + } + + /** + * Set the input property: Describes a connection to a MongoDB data source. + * + * @param input the input value to set. + * @return the ConnectToMongoDbTaskProperties object itself. + */ + public ConnectToMongoDbTaskProperties withInput(MongoDbConnectionInfo input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single MongoDbClusterInfo object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java index 9d009553ce8c3..0aa482f0876d9 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates MySQL database connection. */ @Fluent public final class ConnectToSourceMySqlTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceMySqlTaskInput.class); - /* * Information for connecting to MySQL source */ @@ -32,6 +29,12 @@ public final class ConnectToSourceMySqlTaskInput { @JsonProperty(value = "checkPermissionsGroup") private ServerLevelPermissionsGroup checkPermissionsGroup; + /* + * Flag for whether or not the migration is offline + */ + @JsonProperty(value = "isOfflineMigration") + private Boolean isOfflineMigration; + /** * Get the sourceConnectionInfo property: Information for connecting to MySQL source. * @@ -92,6 +95,26 @@ public ConnectToSourceMySqlTaskInput withCheckPermissionsGroup(ServerLevelPermis return this; } + /** + * Get the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @return the isOfflineMigration value. + */ + public Boolean isOfflineMigration() { + return this.isOfflineMigration; + } + + /** + * Set the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @param isOfflineMigration the isOfflineMigration value to set. + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withIsOfflineMigration(Boolean isOfflineMigration) { + this.isOfflineMigration = isOfflineMigration; + return this; + } + /** * Validates the instance. * @@ -99,7 +122,7 @@ public ConnectToSourceMySqlTaskInput withCheckPermissionsGroup(ServerLevelPermis */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model ConnectToSourceMySqlTaskInput")); @@ -107,4 +130,6 @@ public void validate() { sourceConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToSourceMySqlTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java index 3015508445bef..42ee7fc7219c5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates MySQL database connection. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToSource.MySql") @Fluent public final class ConnectToSourceMySqlTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceMySqlTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToSourceMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java index e75fe47165a21..b856f9098a213 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Output for connect to Oracle, MySQL type source. */ +/** Output for connect to MySQL type source. */ @Immutable public final class ConnectToSourceNonSqlTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceNonSqlTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java new file mode 100644 index 0000000000000..202723cee30c7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the task that validates Oracle database connection. */ +@Fluent +public final class ConnectToSourceOracleSyncTaskInput { + /* + * Information for connecting to Oracle source + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Information for connecting to Oracle source. + * + * @return the sourceConnectionInfo value. + */ + public OracleConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to Oracle source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToSourceOracleSyncTaskInput object itself. + */ + public ConnectToSourceOracleSyncTaskInput withSourceConnectionInfo(OracleConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToSourceOracleSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToSourceOracleSyncTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java new file mode 100644 index 0000000000000..43a0c2b479c7c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the task that validates Oracle database connection. */ +@Immutable +public final class ConnectToSourceOracleSyncTaskOutput { + /* + * Version of the source server + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * List of schemas on source server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the sourceServerVersion property: Version of the source server. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the databases property: List of schemas on source server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java new file mode 100644 index 0000000000000..1eb6dc294ebc6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates Oracle database connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.Oracle.Sync") +@Fluent +public final class ConnectToSourceOracleSyncTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourceOracleSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourceOracleSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourceOracleSyncTaskProperties object itself. + */ + public ConnectToSourceOracleSyncTaskProperties withInput(ConnectToSourceOracleSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceOracleSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java index befd7224866c6..9e2094b7ce356 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to PostgreSQL and source server requirements. */ @Fluent public final class ConnectToSourcePostgreSqlSyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskInput.class); - /* * Connection information for source PostgreSQL server */ @@ -48,7 +45,7 @@ public ConnectToSourcePostgreSqlSyncTaskInput withSourceConnectionInfo( */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -57,4 +54,6 @@ public void validate() { sourceConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java index 75563d8e5ee8e..2d1c5dc72a0f8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for the task that validates connection to PostgreSQL and source server requirements. */ @Immutable public final class ConnectToSourcePostgreSqlSyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java index b200fd27428c9..46450da9844d7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java @@ -5,12 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to PostgreSQL server and source server requirements for online @@ -20,8 +19,6 @@ @JsonTypeName("ConnectToSource.PostgreSql.Sync") @Fluent public final class ConnectToSourcePostgreSqlSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskProperties.class); - /* * Task input */ @@ -63,6 +60,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToSourcePostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java index 5d2f77fcc328a..f9dd9bfdc7add 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java @@ -5,12 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to SQL Server and source server requirements for online migration. @@ -19,8 +18,6 @@ @JsonTypeName("ConnectToSource.SqlServer.Sync") @Fluent public final class ConnectToSourceSqlServerSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerSyncTaskProperties.class); - /* * Task input */ @@ -62,6 +59,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToSourceSqlServerSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java index b4f01feebc644..b4fb0c0a059e5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to SQL Server and also validates source server requirements. */ @Fluent public final class ConnectToSourceSqlServerTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskInput.class); - /* * Connection information for Source SQL Server */ @@ -26,6 +23,12 @@ public final class ConnectToSourceSqlServerTaskInput { @JsonProperty(value = "checkPermissionsGroup") private ServerLevelPermissionsGroup checkPermissionsGroup; + /* + * Flag for whether to collect databases from source server. + */ + @JsonProperty(value = "collectDatabases") + private Boolean collectDatabases; + /* * Flag for whether to collect logins from source server. */ @@ -38,6 +41,25 @@ public final class ConnectToSourceSqlServerTaskInput { @JsonProperty(value = "collectAgentJobs") private Boolean collectAgentJobs; + /* + * Flag for whether to collect TDE Certificate names from source server. + */ + @JsonProperty(value = "collectTdeCertificateInfo") + private Boolean collectTdeCertificateInfo; + + /* + * Flag for whether to validate SSIS catalog is reachable on the source + * server. + */ + @JsonProperty(value = "validateSsisCatalogOnly") + private Boolean validateSsisCatalogOnly; + + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + /** * Get the sourceConnectionInfo property: Connection information for Source SQL Server. * @@ -79,6 +101,26 @@ public ConnectToSourceSqlServerTaskInput withCheckPermissionsGroup( return this; } + /** + * Get the collectDatabases property: Flag for whether to collect databases from source server. + * + * @return the collectDatabases value. + */ + public Boolean collectDatabases() { + return this.collectDatabases; + } + + /** + * Set the collectDatabases property: Flag for whether to collect databases from source server. + * + * @param collectDatabases the collectDatabases value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectDatabases(Boolean collectDatabases) { + this.collectDatabases = collectDatabases; + return this; + } + /** * Get the collectLogins property: Flag for whether to collect logins from source server. * @@ -119,6 +161,68 @@ public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAge return this; } + /** + * Get the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @return the collectTdeCertificateInfo value. + */ + public Boolean collectTdeCertificateInfo() { + return this.collectTdeCertificateInfo; + } + + /** + * Set the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @param collectTdeCertificateInfo the collectTdeCertificateInfo value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectTdeCertificateInfo(Boolean collectTdeCertificateInfo) { + this.collectTdeCertificateInfo = collectTdeCertificateInfo; + return this; + } + + /** + * Get the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @return the validateSsisCatalogOnly value. + */ + public Boolean validateSsisCatalogOnly() { + return this.validateSsisCatalogOnly; + } + + /** + * Set the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @param validateSsisCatalogOnly the validateSsisCatalogOnly value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withValidateSsisCatalogOnly(Boolean validateSsisCatalogOnly) { + this.validateSsisCatalogOnly = validateSsisCatalogOnly; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * Validates the instance. * @@ -126,7 +230,7 @@ public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAge */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model ConnectToSourceSqlServerTaskInput")); @@ -134,4 +238,6 @@ public void validate() { sourceConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToSourceSqlServerTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java index 466f14ce46e7f..fcfb3522165cb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -27,8 +25,6 @@ }) @Immutable public class ConnectToSourceSqlServerTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java index d4522ca467e69..5f02ede146b88 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java @@ -5,54 +5,56 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; +import java.util.List; /** - * AgentJob level output for the task that validates connection to SQL Server and also validates source server + * Agent Job level output for the task that validates connection to SQL Server and also validates source server * requirements. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("AgentJobLevelOutput") @Immutable public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputAgentJobLevel.class); - /* - * AgentJob name + * Agent Job name */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * The type of AgentJob. + * The type of Agent Job. */ @JsonProperty(value = "jobCategory", access = JsonProperty.Access.WRITE_ONLY) private String jobCategory; /* - * The state of the original AgentJob. + * The state of the original Agent Job. */ @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean isEnabled; /* - * The owner of the AgentJob + * The owner of the Agent Job */ @JsonProperty(value = "jobOwner", access = JsonProperty.Access.WRITE_ONLY) private String jobOwner; /* - * UTC Date and time when the AgentJob was last executed. + * UTC Date and time when the Agent Job was last executed. */ @JsonProperty(value = "lastExecutedOn", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastExecutedOn; + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + /* * Information about eligibility of agent job for migration. */ @@ -60,7 +62,7 @@ public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends Conne private MigrationEligibilityInfo migrationEligibility; /** - * Get the name property: AgentJob name. + * Get the name property: Agent Job name. * * @return the name value. */ @@ -69,7 +71,7 @@ public String name() { } /** - * Get the jobCategory property: The type of AgentJob. + * Get the jobCategory property: The type of Agent Job. * * @return the jobCategory value. */ @@ -78,7 +80,7 @@ public String jobCategory() { } /** - * Get the isEnabled property: The state of the original AgentJob. + * Get the isEnabled property: The state of the original Agent Job. * * @return the isEnabled value. */ @@ -87,7 +89,7 @@ public Boolean isEnabled() { } /** - * Get the jobOwner property: The owner of the AgentJob. + * Get the jobOwner property: The owner of the Agent Job. * * @return the jobOwner value. */ @@ -96,7 +98,7 @@ public String jobOwner() { } /** - * Get the lastExecutedOn property: UTC Date and time when the AgentJob was last executed. + * Get the lastExecutedOn property: UTC Date and time when the Agent Job was last executed. * * @return the lastExecutedOn value. */ @@ -104,6 +106,15 @@ public OffsetDateTime lastExecutedOn() { return this.lastExecutedOn; } + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + /** * Get the migrationEligibility property: Information about eligibility of agent job for migration. * @@ -121,6 +132,9 @@ public MigrationEligibilityInfo migrationEligibility() { @Override public void validate() { super.validate(); + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } if (migrationEligibility() != null) { migrationEligibility().validate(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java index 34d9ef83e763f..c06096ecd957b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -20,9 +18,6 @@ @JsonTypeName("DatabaseLevelOutput") @Immutable public final class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputDatabaseLevel.class); - /* * Database name */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java index cad556c42c9eb..8c44e3a83a51f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -19,9 +17,6 @@ @JsonTypeName("LoginLevelOutput") @Immutable public final class ConnectToSourceSqlServerTaskOutputLoginLevel extends ConnectToSourceSqlServerTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputLoginLevel.class); - /* * Login name. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java index 6d0a589c4cc1a..43c6b58b8a549 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -19,8 +17,6 @@ @JsonTypeName("TaskLevelOutput") @Immutable public final class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputTaskLevel.class); - /* * Source databases as a map from database name to database id */ @@ -39,6 +35,12 @@ public final class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectTo @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) private String agentJobs; + /* + * Mapping from database name to TDE certificate name, if applicable + */ + @JsonProperty(value = "databaseTdeCertificateMapping", access = JsonProperty.Access.WRITE_ONLY) + private String databaseTdeCertificateMapping; + /* * Source server version */ @@ -84,6 +86,16 @@ public String agentJobs() { return this.agentJobs; } + /** + * Get the databaseTdeCertificateMapping property: Mapping from database name to TDE certificate name, if + * applicable. + * + * @return the databaseTdeCertificateMapping value. + */ + public String databaseTdeCertificateMapping() { + return this.databaseTdeCertificateMapping; + } + /** * Get the sourceServerVersion property: Source server version. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java index 1706d70b10989..bc65d28ce12c8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to SQL Server and also validates source server requirements. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToSource.SqlServer") @Fluent public final class ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskProperties.class); - /* * Task input */ @@ -31,6 +28,12 @@ public final class ConnectToSourceSqlServerTaskProperties extends ProjectTaskPro @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * Task id + */ + @JsonProperty(value = "taskId") + private String taskId; + /** * Get the input property: Task input. * @@ -60,6 +63,33 @@ public List output() { return this.output; } + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceSqlServerTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java index 2ce171f1e2ca9..ab7ffe42ce621 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to Azure Database for MySQL and target server requirements. */ @Fluent public final class ConnectToTargetAzureDbForMySqlTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskInput.class); - /* * Connection information for source MySQL server */ @@ -26,6 +23,12 @@ public final class ConnectToTargetAzureDbForMySqlTaskInput { @JsonProperty(value = "targetConnectionInfo", required = true) private MySqlConnectionInfo targetConnectionInfo; + /* + * Flag for whether or not the migration is offline + */ + @JsonProperty(value = "isOfflineMigration") + private Boolean isOfflineMigration; + /** * Get the sourceConnectionInfo property: Connection information for source MySQL server. * @@ -66,6 +69,26 @@ public ConnectToTargetAzureDbForMySqlTaskInput withTargetConnectionInfo(MySqlCon return this; } + /** + * Get the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @return the isOfflineMigration value. + */ + public Boolean isOfflineMigration() { + return this.isOfflineMigration; + } + + /** + * Set the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @param isOfflineMigration the isOfflineMigration value to set. + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withIsOfflineMigration(Boolean isOfflineMigration) { + this.isOfflineMigration = isOfflineMigration; + return this; + } + /** * Validates the instance. * @@ -73,7 +96,7 @@ public ConnectToTargetAzureDbForMySqlTaskInput withTargetConnectionInfo(MySqlCon */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -82,7 +105,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -91,4 +114,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java index 07ddbedeeafa4..e84205e3c4ef4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for the task that validates connection to Azure Database for MySQL and target server requirements. */ @Immutable public final class ConnectToTargetAzureDbForMySqlTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java index 26cd9fea13f88..9e8a5eaffb14a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to Azure Database for MySQL and target server requirements. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToTarget.AzureDbForMySql") @Fluent public final class ConnectToTargetAzureDbForMySqlTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskProperties.class); - /* * Task input */ @@ -61,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToTargetAzureDbForMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java index 9cf8c3daf4a7f..935399d639776 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java @@ -6,15 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements. */ @Fluent public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.class); - /* * Connection information for source PostgreSQL server */ @@ -76,7 +72,7 @@ public ConnectToTargetAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -85,7 +81,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -94,4 +90,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java index 86cd66fb3e941..f5135805cf244 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements. */ @Immutable public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java index 3964143ddf8b1..0231c7f523f16 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java @@ -5,12 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to Azure Database For PostgreSQL server and target server @@ -20,9 +19,6 @@ @JsonTypeName("ConnectToTarget.AzureDbForPostgreSql.Sync") @Fluent public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.class); - /* * Task input */ @@ -65,6 +61,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java new file mode 100644 index 0000000000000..f9b9c68333678 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput { + /* + * Connection information for target Azure Database for PostgreSQL server + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = + new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java new file mode 100644 index 0000000000000..de335876d553f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput { + /* + * Version of the target server + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * List of databases on target server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /* + * Mapping of schemas per database + */ + @JsonProperty(value = "databaseSchemaMap") + private List databaseSchemaMap; + + /** + * Get the targetServerVersion property: Version of the target server. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the databases property: List of databases on target server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Get the databaseSchemaMap property: Mapping of schemas per database. + * + * @return the databaseSchemaMap value. + */ + public List databaseSchemaMap() { + return this.databaseSchemaMap; + } + + /** + * Set the databaseSchemaMap property: Mapping of schemas per database. + * + * @param databaseSchemaMap the databaseSchemaMap value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput withDatabaseSchemaMap( + List databaseSchemaMap) { + this.databaseSchemaMap = databaseSchemaMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + if (databaseSchemaMap() != null) { + databaseSchemaMap().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java new file mode 100644 index 0000000000000..34bab4be05a09 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem model. */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem { + /* + * The database property. + */ + @JsonProperty(value = "database") + private String database; + + /* + * The schemas property. + */ + @JsonProperty(value = "schemas") + private List schemas; + + /** + * Get the database property: The database property. + * + * @return the database value. + */ + public String database() { + return this.database; + } + + /** + * Set the database property: The database property. + * + * @param database the database value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem withDatabase(String database) { + this.database = database; + return this; + } + + /** + * Get the schemas property: The schemas property. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Set the schemas property: The schemas property. + * + * @param schemas the schemas value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem withSchemas( + List schemas) { + this.schemas = schemas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 0000000000000..ccf6f29dfba1d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates connection to Azure Database For PostgreSQL server and target server + * requirements for online migration for Oracle source. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java index ccab5bb5c749e..fccbc907bffa6 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to Azure SQL DB and target server requirements. */ @Fluent public final class ConnectToTargetSqlDbSyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbSyncTaskInput.class); - /* * Connection information for source SQL Server */ @@ -73,7 +70,7 @@ public ConnectToTargetSqlDbSyncTaskInput withTargetConnectionInfo(SqlConnectionI */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model ConnectToTargetSqlDbSyncTaskInput")); @@ -81,7 +78,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model ConnectToTargetSqlDbSyncTaskInput")); @@ -89,4 +86,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetSqlDbSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java index 22dac03eb3807..4a0103c47d32b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to SQL DB and target server requirements for online migration. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToTarget.SqlDb.Sync") @Fluent public final class ConnectToTargetSqlDbSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbSyncTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java index 2a542e7b57e7a..e01d60c1c131b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java @@ -6,20 +6,24 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to SQL DB and target server requirements. */ @Fluent public final class ConnectToTargetSqlDbTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskInput.class); - /* * Connection information for target SQL DB */ @JsonProperty(value = "targetConnectionInfo", required = true) private SqlConnectionInfo targetConnectionInfo; + /* + * Boolean flag indicating whether to query object counts for each database + * on the target server + */ + @JsonProperty(value = "queryObjectCounts") + private Boolean queryObjectCounts; + /** * Get the targetConnectionInfo property: Connection information for target SQL DB. * @@ -40,6 +44,28 @@ public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo return this; } + /** + * Get the queryObjectCounts property: Boolean flag indicating whether to query object counts for each database on + * the target server. + * + * @return the queryObjectCounts value. + */ + public Boolean queryObjectCounts() { + return this.queryObjectCounts; + } + + /** + * Set the queryObjectCounts property: Boolean flag indicating whether to query object counts for each database on + * the target server. + * + * @param queryObjectCounts the queryObjectCounts value to set. + * @return the ConnectToTargetSqlDbTaskInput object itself. + */ + public ConnectToTargetSqlDbTaskInput withQueryObjectCounts(Boolean queryObjectCounts) { + this.queryObjectCounts = queryObjectCounts; + return this; + } + /** * Validates the instance. * @@ -47,7 +73,7 @@ public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo */ public void validate() { if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model ConnectToTargetSqlDbTaskInput")); @@ -55,4 +81,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetSqlDbTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java index d9dabc75a9d45..87944ac2affc2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Output for the task that validates connection to SQL DB and target server requirements. */ @Immutable public final class ConnectToTargetSqlDbTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java index 1471aa45c47f6..1d6819784b604 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to SQL DB and target server requirements. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToTarget.SqlDb") @Fluent public final class ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskProperties.class); - /* * Task input */ @@ -31,6 +28,12 @@ public final class ConnectToTargetSqlDbTaskProperties extends ProjectTaskPropert @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + /** * Get the input property: Task input. * @@ -60,6 +63,33 @@ public List output() { return this.output; } + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java index 0628a4cc1ce59..808cc84d991ce 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. */ @Fluent public final class ConnectToTargetSqlMISyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskInput.class); - /* * Connection information for Azure SQL Database Managed Instance */ @@ -77,7 +74,7 @@ public ConnectToTargetSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp az */ public void validate() { if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model ConnectToTargetSqlMISyncTaskInput")); @@ -85,7 +82,7 @@ public void validate() { targetConnectionInfo().validate(); } if (azureApp() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property azureApp in model ConnectToTargetSqlMISyncTaskInput")); @@ -93,4 +90,6 @@ public void validate() { azureApp().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetSqlMISyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java index e678c6bc4abe7..59fd37271a8d3 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for the task that validates connection to Azure SQL Database Managed Instance. */ @Immutable public final class ConnectToTargetSqlMISyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskOutput.class); - /* * Target server version */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java index 1a060f8050c7f..a367c991f1581 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to Azure SQL Database Managed Instance. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToTarget.AzureSqlDbMI.Sync.LRS") @Fluent public final class ConnectToTargetSqlMISyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java index d984e78fd27a2..80d331b223609 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java @@ -6,20 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for the task that validates connection to Azure SQL Database Managed Instance. */ @Fluent public final class ConnectToTargetSqlMITaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskInput.class); - /* * Connection information for target SQL Server */ @JsonProperty(value = "targetConnectionInfo", required = true) private SqlConnectionInfo targetConnectionInfo; + /* + * Flag for whether to collect logins from target SQL MI server. + */ + @JsonProperty(value = "collectLogins") + private Boolean collectLogins; + + /* + * Flag for whether to collect agent jobs from target SQL MI server. + */ + @JsonProperty(value = "collectAgentJobs") + private Boolean collectAgentJobs; + + /* + * Flag for whether to validate SSIS catalog is reachable on the target SQL + * MI server. + */ + @JsonProperty(value = "validateSsisCatalogOnly") + private Boolean validateSsisCatalogOnly; + /** * Get the targetConnectionInfo property: Connection information for target SQL Server. * @@ -40,6 +56,68 @@ public ConnectToTargetSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo return this; } + /** + * Get the collectLogins property: Flag for whether to collect logins from target SQL MI server. + * + * @return the collectLogins value. + */ + public Boolean collectLogins() { + return this.collectLogins; + } + + /** + * Set the collectLogins property: Flag for whether to collect logins from target SQL MI server. + * + * @param collectLogins the collectLogins value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withCollectLogins(Boolean collectLogins) { + this.collectLogins = collectLogins; + return this; + } + + /** + * Get the collectAgentJobs property: Flag for whether to collect agent jobs from target SQL MI server. + * + * @return the collectAgentJobs value. + */ + public Boolean collectAgentJobs() { + return this.collectAgentJobs; + } + + /** + * Set the collectAgentJobs property: Flag for whether to collect agent jobs from target SQL MI server. + * + * @param collectAgentJobs the collectAgentJobs value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withCollectAgentJobs(Boolean collectAgentJobs) { + this.collectAgentJobs = collectAgentJobs; + return this; + } + + /** + * Get the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the target + * SQL MI server. + * + * @return the validateSsisCatalogOnly value. + */ + public Boolean validateSsisCatalogOnly() { + return this.validateSsisCatalogOnly; + } + + /** + * Set the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the target + * SQL MI server. + * + * @param validateSsisCatalogOnly the validateSsisCatalogOnly value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withValidateSsisCatalogOnly(Boolean validateSsisCatalogOnly) { + this.validateSsisCatalogOnly = validateSsisCatalogOnly; + return this; + } + /** * Validates the instance. * @@ -47,7 +125,7 @@ public ConnectToTargetSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo */ public void validate() { if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model ConnectToTargetSqlMITaskInput")); @@ -55,4 +133,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToTargetSqlMITaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java index a08a082628420..6a3466169e673 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for the task that validates connection to Azure SQL Database Managed Instance. */ @Immutable public final class ConnectToTargetSqlMITaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java index 11bed818eb6a1..cfb4c1dda4e8e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that validates connection to Azure SQL Database Managed Instance. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ConnectToTarget.AzureSqlDbMI") @Fluent public final class ConnectToTargetSqlMITaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java index 7edae7f4e68f2..ad8120d297593 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -20,15 +18,15 @@ defaultImpl = ConnectionInfo.class) @JsonTypeName("ConnectionInfo") @JsonSubTypes({ + @JsonSubTypes.Type(name = "MongoDbConnectionInfo", value = MongoDbConnectionInfo.class), @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), @JsonSubTypes.Type(name = "MySqlConnectionInfo", value = MySqlConnectionInfo.class), + @JsonSubTypes.Type(name = "OracleConnectionInfo", value = OracleConnectionInfo.class), @JsonSubTypes.Type(name = "PostgreSqlConnectionInfo", value = PostgreSqlConnectionInfo.class), @JsonSubTypes.Type(name = "MiSqlConnectionInfo", value = MiSqlConnectionInfo.class) }) @Fluent public class ConnectionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionInfo.class); - /* * User name */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java new file mode 100644 index 0000000000000..b8f63ac835ccb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Details on progress of ADF copy activity. */ +@Immutable +public final class CopyProgressDetails { + /* + * Table Name + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Type of parallel copy (Dynamic range, Physical partition, none). + */ + @JsonProperty(value = "parallelCopyType", access = JsonProperty.Access.WRITE_ONLY) + private String parallelCopyType; + + /* + * The degree of parallelization. + */ + @JsonProperty(value = "usedParallelCopies", access = JsonProperty.Access.WRITE_ONLY) + private Integer usedParallelCopies; + + /* + * Bytes read + */ + @JsonProperty(value = "dataRead", access = JsonProperty.Access.WRITE_ONLY) + private Long dataRead; + + /* + * Bytes written + */ + @JsonProperty(value = "dataWritten", access = JsonProperty.Access.WRITE_ONLY) + private Long dataWritten; + + /* + * Rows read + */ + @JsonProperty(value = "rowsRead", access = JsonProperty.Access.WRITE_ONLY) + private Long rowsRead; + + /* + * Rows Copied + */ + @JsonProperty(value = "rowsCopied", access = JsonProperty.Access.WRITE_ONLY) + private Long rowsCopied; + + /* + * Copy Start + */ + @JsonProperty(value = "copyStart", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime copyStart; + + /* + * Copy throughput in KBps + */ + @JsonProperty(value = "copyThroughput", access = JsonProperty.Access.WRITE_ONLY) + private Double copyThroughput; + + /* + * Copy Duration in seconds + */ + @JsonProperty(value = "copyDuration", access = JsonProperty.Access.WRITE_ONLY) + private Integer copyDuration; + + /** + * Get the tableName property: Table Name. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the status property: Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the parallelCopyType property: Type of parallel copy (Dynamic range, Physical partition, none). + * + * @return the parallelCopyType value. + */ + public String parallelCopyType() { + return this.parallelCopyType; + } + + /** + * Get the usedParallelCopies property: The degree of parallelization. + * + * @return the usedParallelCopies value. + */ + public Integer usedParallelCopies() { + return this.usedParallelCopies; + } + + /** + * Get the dataRead property: Bytes read. + * + * @return the dataRead value. + */ + public Long dataRead() { + return this.dataRead; + } + + /** + * Get the dataWritten property: Bytes written. + * + * @return the dataWritten value. + */ + public Long dataWritten() { + return this.dataWritten; + } + + /** + * Get the rowsRead property: Rows read. + * + * @return the rowsRead value. + */ + public Long rowsRead() { + return this.rowsRead; + } + + /** + * Get the rowsCopied property: Rows Copied. + * + * @return the rowsCopied value. + */ + public Long rowsCopied() { + return this.rowsCopied; + } + + /** + * Get the copyStart property: Copy Start. + * + * @return the copyStart value. + */ + public OffsetDateTime copyStart() { + return this.copyStart; + } + + /** + * Get the copyThroughput property: Copy throughput in KBps. + * + * @return the copyThroughput value. + */ + public Double copyThroughput() { + return this.copyThroughput; + } + + /** + * Get the copyDuration property: Copy Duration in seconds. + * + * @return the copyDuration value. + */ + public Integer copyDuration() { + return this.copyDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java index af960c21e8b90..be6a074f51787 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java @@ -4,27 +4,25 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Results for checksum based Data Integrity validation results. */ -@Immutable +@Fluent public final class DataIntegrityValidationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataIntegrityValidationResult.class); - /* * List of failed table names of source and target pair */ - @JsonProperty(value = "failedObjects", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "failedObjects") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map failedObjects; /* * List of errors that happened while performing data integrity validation */ - @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "validationErrors") private ValidationError validationErrors; /** @@ -36,6 +34,17 @@ public Map failedObjects() { return this.failedObjects; } + /** + * Set the failedObjects property: List of failed table names of source and target pair. + * + * @param failedObjects the failedObjects value to set. + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withFailedObjects(Map failedObjects) { + this.failedObjects = failedObjects; + return this; + } + /** * Get the validationErrors property: List of errors that happened while performing data integrity validation. * @@ -45,6 +54,17 @@ public ValidationError validationErrors() { return this.validationErrors; } + /** + * Set the validationErrors property: List of errors that happened while performing data integrity validation. + * + * @param validationErrors the validationErrors value to set. + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java index 377fa2f0f3dcd..1e959f9a6de4e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Basic summary of a data item migration. */ @Immutable public class DataItemMigrationSummaryResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataItemMigrationSummaryResult.class); - /* * Name of the item */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java deleted file mode 100644 index 032c7fc72ec11..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Migration Task errors. */ -@Fluent -public final class DataMigrationError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationError.class); - - /* - * Error description - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /* - * Type of error. - */ - @JsonProperty(value = "type") - private ErrorType type; - - /** - * Get the message property: Error description. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the type property: Type of error. - * - * @return the type value. - */ - public ErrorType type() { - return this.type; - } - - /** - * Set the type property: Type of error. - * - * @param type the type value to set. - * @return the DataMigrationError object itself. - */ - public DataMigrationError withType(ErrorType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java deleted file mode 100644 index affe03594063a..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DataMigrationResultCode. */ -public final class DataMigrationResultCode extends ExpandableStringEnum { - /** Static value Initial for DataMigrationResultCode. */ - public static final DataMigrationResultCode INITIAL = fromString("Initial"); - - /** Static value Completed for DataMigrationResultCode. */ - public static final DataMigrationResultCode COMPLETED = fromString("Completed"); - - /** Static value ObjectNotExistsInSource for DataMigrationResultCode. */ - public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_SOURCE = fromString("ObjectNotExistsInSource"); - - /** Static value ObjectNotExistsInTarget for DataMigrationResultCode. */ - public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_TARGET = fromString("ObjectNotExistsInTarget"); - - /** Static value TargetObjectIsInaccessible for DataMigrationResultCode. */ - public static final DataMigrationResultCode TARGET_OBJECT_IS_INACCESSIBLE = - fromString("TargetObjectIsInaccessible"); - - /** Static value FatalError for DataMigrationResultCode. */ - public static final DataMigrationResultCode FATAL_ERROR = fromString("FatalError"); - - /** - * Creates or finds a DataMigrationResultCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataMigrationResultCode. - */ - @JsonCreator - public static DataMigrationResultCode fromString(String name) { - return fromString(name, DataMigrationResultCode.class); - } - - /** @return known DataMigrationResultCode values. */ - public static Collection values() { - return values(DataMigrationResultCode.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java index 35b95178f5ae5..5ecb7274da41b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; import java.util.Map; @@ -68,6 +69,13 @@ public interface DataMigrationService { */ ServiceSku sku(); + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the provisioningState property: The resource's provisioning state. * @@ -90,6 +98,29 @@ public interface DataMigrationService { */ String virtualSubnetId(); + /** + * Gets the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service + * have. + * + * @return the virtualNicId value. + */ + String virtualNicId(); + + /** + * Gets the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @return the autoStopDelay value. + */ + String autoStopDelay(); + + /** + * Gets the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @return the deleteResourcesOnStop value. + */ + Boolean deleteResourcesOnStop(); + /** * Gets the region of the resource. * @@ -161,7 +192,10 @@ interface WithCreate DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithPublicKey, - DefinitionStages.WithVirtualSubnetId { + DefinitionStages.WithVirtualSubnetId, + DefinitionStages.WithVirtualNicId, + DefinitionStages.WithAutoStopDelay, + DefinitionStages.WithDeleteResourcesOnStop { /** * Executes the create request. * @@ -240,6 +274,39 @@ interface WithVirtualSubnetId { */ WithCreate withVirtualSubnetId(String virtualSubnetId); } + /** The stage of the DataMigrationService definition allowing to specify virtualNicId. */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + WithCreate withVirtualNicId(String virtualNicId); + } + /** The stage of the DataMigrationService definition allowing to specify autoStopDelay. */ + interface WithAutoStopDelay { + /** + * Specifies the autoStopDelay property: The time delay before the service is auto-stopped when idle.. + * + * @param autoStopDelay The time delay before the service is auto-stopped when idle. + * @return the next definition stage. + */ + WithCreate withAutoStopDelay(String autoStopDelay); + } + /** The stage of the DataMigrationService definition allowing to specify deleteResourcesOnStop. */ + interface WithDeleteResourcesOnStop { + /** + * Specifies the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. + * (Turned on by default). + * + * @param deleteResourcesOnStop Whether service resources should be deleted when stopped. (Turned on by + * default). + * @return the next definition stage. + */ + WithCreate withDeleteResourcesOnStop(Boolean deleteResourcesOnStop); + } } /** * Begins update for the DataMigrationService resource. @@ -255,7 +322,10 @@ interface Update UpdateStages.WithKind, UpdateStages.WithSku, UpdateStages.WithPublicKey, - UpdateStages.WithVirtualSubnetId { + UpdateStages.WithVirtualSubnetId, + UpdateStages.WithVirtualNicId, + UpdateStages.WithAutoStopDelay, + UpdateStages.WithDeleteResourcesOnStop { /** * Executes the update request. * @@ -336,6 +406,39 @@ interface WithVirtualSubnetId { */ Update withVirtualSubnetId(String virtualSubnetId); } + /** The stage of the DataMigrationService update allowing to specify virtualNicId. */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + Update withVirtualNicId(String virtualNicId); + } + /** The stage of the DataMigrationService update allowing to specify autoStopDelay. */ + interface WithAutoStopDelay { + /** + * Specifies the autoStopDelay property: The time delay before the service is auto-stopped when idle.. + * + * @param autoStopDelay The time delay before the service is auto-stopped when idle. + * @return the next definition stage. + */ + Update withAutoStopDelay(String autoStopDelay); + } + /** The stage of the DataMigrationService update allowing to specify deleteResourcesOnStop. */ + interface WithDeleteResourcesOnStop { + /** + * Specifies the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. + * (Turned on by default). + * + * @param deleteResourcesOnStop Whether service resources should be deleted when stopped. (Turned on by + * default). + * @return the next definition stage. + */ + Update withDeleteResourcesOnStop(Boolean deleteResourcesOnStop); + } } /** * Refreshes the resource to sync with Azure. @@ -370,7 +473,7 @@ interface WithVirtualSubnetId { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response}. */ Response checkStatusWithResponse(Context context); @@ -425,7 +528,7 @@ interface WithVirtualSubnetId { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return indicates whether a proposed resource name is available. */ - NameAvailabilityResponse nestedCheckNameAvailability(NameAvailabilityRequest parameters); + NameAvailabilityResponse checkChildrenNameAvailability(NameAvailabilityRequest parameters); /** * This method checks whether a proposed nested resource name is valid and available. @@ -435,8 +538,8 @@ interface WithVirtualSubnetId { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( NameAvailabilityRequest parameters, Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java index 45333a416e363..b03d38321c3fc 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** OData page of service objects. */ @Fluent public final class DataMigrationServiceList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceList.class); - /* * List of services */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java index 57c2442729458..f94987f3dd882 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java @@ -16,6 +16,13 @@ public interface DataMigrationServiceStatusResponse { */ String agentVersion(); + /** + * Gets the agentConfiguration property: Agent Configuration. + * + * @return the agentConfiguration value. + */ + Object agentConfiguration(); + /** * Gets the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java index 72dd6c49188ac..d9e1e4dcedae5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -14,8 +12,6 @@ /** Information about backup files when existing backup mode is used. */ @Immutable public final class DatabaseBackupInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseBackupInfo.class); - /* * Database name. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java index da8cd95f1cdc6..60c7cf569bf0e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Database file specific information. */ @Fluent public final class DatabaseFileInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseFileInfo.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java deleted file mode 100644 index 741ad6aacd9ab..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Database file specific information for input. */ -@Fluent -public final class DatabaseFileInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseFileInput.class); - - /* - * Unique identifier for database file - */ - @JsonProperty(value = "id") - private String id; - - /* - * Logical name of the file - */ - @JsonProperty(value = "logicalName") - private String logicalName; - - /* - * Operating-system full path of the file - */ - @JsonProperty(value = "physicalFullName") - private String physicalFullName; - - /* - * Suggested full path of the file for restoring - */ - @JsonProperty(value = "restoreFullName") - private String restoreFullName; - - /* - * Database file type - */ - @JsonProperty(value = "fileType") - private DatabaseFileType fileType; - - /** - * Get the id property: Unique identifier for database file. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Unique identifier for database file. - * - * @param id the id value to set. - * @return the DatabaseFileInput object itself. - */ - public DatabaseFileInput withId(String id) { - this.id = id; - return this; - } - - /** - * Get the logicalName property: Logical name of the file. - * - * @return the logicalName value. - */ - public String logicalName() { - return this.logicalName; - } - - /** - * Set the logicalName property: Logical name of the file. - * - * @param logicalName the logicalName value to set. - * @return the DatabaseFileInput object itself. - */ - public DatabaseFileInput withLogicalName(String logicalName) { - this.logicalName = logicalName; - return this; - } - - /** - * Get the physicalFullName property: Operating-system full path of the file. - * - * @return the physicalFullName value. - */ - public String physicalFullName() { - return this.physicalFullName; - } - - /** - * Set the physicalFullName property: Operating-system full path of the file. - * - * @param physicalFullName the physicalFullName value to set. - * @return the DatabaseFileInput object itself. - */ - public DatabaseFileInput withPhysicalFullName(String physicalFullName) { - this.physicalFullName = physicalFullName; - return this; - } - - /** - * Get the restoreFullName property: Suggested full path of the file for restoring. - * - * @return the restoreFullName value. - */ - public String restoreFullName() { - return this.restoreFullName; - } - - /** - * Set the restoreFullName property: Suggested full path of the file for restoring. - * - * @param restoreFullName the restoreFullName value to set. - * @return the DatabaseFileInput object itself. - */ - public DatabaseFileInput withRestoreFullName(String restoreFullName) { - this.restoreFullName = restoreFullName; - return this; - } - - /** - * Get the fileType property: Database file type. - * - * @return the fileType value. - */ - public DatabaseFileType fileType() { - return this.fileType; - } - - /** - * Set the fileType property: Database file type. - * - * @param fileType the fileType value to set. - * @return the DatabaseFileInput object itself. - */ - public DatabaseFileInput withFileType(DatabaseFileType fileType) { - this.fileType = fileType; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java index 12a3552bc3020..ad6f66f0dca8e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Project Database Details. */ @Fluent public final class DatabaseInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInfo.class); - /* * Name of the database */ @@ -47,9 +44,11 @@ public DatabaseInfo withSourceDatabaseName(String sourceDatabaseName) { */ public void validate() { if (sourceDatabaseName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sourceDatabaseName in model DatabaseInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(DatabaseInfo.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java new file mode 100644 index 0000000000000..9555dfc66dcfe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; + +/** An immutable client-side representation of DatabaseMigration. */ +public interface DatabaseMigration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Database Migration Resource properties. + * + * @return the properties value. + */ + DatabaseMigrationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner object. + * + * @return the inner object. + */ + DatabaseMigrationInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java new file mode 100644 index 0000000000000..f0416d236bcd9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Database Migrations. */ +@Immutable +public final class DatabaseMigrationListResult { + /* + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java new file mode 100644 index 0000000000000..d3bb75e831cdf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Database Migration Resource properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = DatabaseMigrationProperties.class) +@JsonTypeName("DatabaseMigrationProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SqlDb", value = DatabaseMigrationPropertiesSqlDb.class), + @JsonSubTypes.Type(name = "SqlMi", value = DatabaseMigrationPropertiesSqlMi.class), + @JsonSubTypes.Type(name = "SqlVm", value = DatabaseMigrationPropertiesSqlVm.class) +}) +@Fluent +public class DatabaseMigrationProperties { + /* + * Resource Id of the target resource (SQL VM or SQL Managed Instance). + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * Provisioning State of migration. ProvisioningState as Succeeded implies + * that validations have been performed and migration has started. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Migration status. + */ + @JsonProperty(value = "migrationStatus", access = JsonProperty.Access.WRITE_ONLY) + private String migrationStatus; + + /* + * Database migration start time. + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Database migration end time. + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source SQL Server connection details. + */ + @JsonProperty(value = "sourceSqlConnection") + private SqlConnectionInformation sourceSqlConnection; + + /* + * Name of the source database. + */ + @JsonProperty(value = "sourceDatabaseName") + private String sourceDatabaseName; + + /* + * Name of the source sql server. + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /* + * Resource Id of the Migration Service. + */ + @JsonProperty(value = "migrationService") + private String migrationService; + + /* + * ID tracking current migration operation. + */ + @JsonProperty(value = "migrationOperationId") + private String migrationOperationId; + + /* + * Error details in case of migration failure. + */ + @JsonProperty(value = "migrationFailureError", access = JsonProperty.Access.WRITE_ONLY) + private ErrorInfo migrationFailureError; + + /** + * Get the scope property: Resource Id of the target resource (SQL VM or SQL Managed Instance). + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: Resource Id of the target resource (SQL VM or SQL Managed Instance). + * + * @param scope the scope value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the provisioningState property: Provisioning State of migration. ProvisioningState as Succeeded implies that + * validations have been performed and migration has started. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the migrationStatus property: Migration status. + * + * @return the migrationStatus value. + */ + public String migrationStatus() { + return this.migrationStatus; + } + + /** + * Get the startedOn property: Database migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Database migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceSqlConnection property: Source SQL Server connection details. + * + * @return the sourceSqlConnection value. + */ + public SqlConnectionInformation sourceSqlConnection() { + return this.sourceSqlConnection; + } + + /** + * Set the sourceSqlConnection property: Source SQL Server connection details. + * + * @param sourceSqlConnection the sourceSqlConnection value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + this.sourceSqlConnection = sourceSqlConnection; + return this; + } + + /** + * Get the sourceDatabaseName property: Name of the source database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set the sourceDatabaseName property: Name of the source database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + + /** + * Get the sourceServerName property: Name of the source sql server. + * + * @return the sourceServerName value. + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get the migrationService property: Resource Id of the Migration Service. + * + * @return the migrationService value. + */ + public String migrationService() { + return this.migrationService; + } + + /** + * Set the migrationService property: Resource Id of the Migration Service. + * + * @param migrationService the migrationService value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withMigrationService(String migrationService) { + this.migrationService = migrationService; + return this; + } + + /** + * Get the migrationOperationId property: ID tracking current migration operation. + * + * @return the migrationOperationId value. + */ + public String migrationOperationId() { + return this.migrationOperationId; + } + + /** + * Set the migrationOperationId property: ID tracking current migration operation. + * + * @param migrationOperationId the migrationOperationId value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withMigrationOperationId(String migrationOperationId) { + this.migrationOperationId = migrationOperationId; + return this; + } + + /** + * Get the migrationFailureError property: Error details in case of migration failure. + * + * @return the migrationFailureError value. + */ + public ErrorInfo migrationFailureError() { + return this.migrationFailureError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceSqlConnection() != null) { + sourceSqlConnection().validate(); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java new file mode 100644 index 0000000000000..15882a4415451 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Database Migration Resource properties for SQL database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SqlDb") +@Fluent +public final class DatabaseMigrationPropertiesSqlDb extends DatabaseMigrationProperties { + /* + * Detailed migration status. Not included by default. + */ + @JsonProperty(value = "migrationStatusDetails", access = JsonProperty.Access.WRITE_ONLY) + private SqlDbMigrationStatusDetails migrationStatusDetails; + + /* + * Target SQL DB connection details. + */ + @JsonProperty(value = "targetSqlConnection") + private SqlConnectionInformation targetSqlConnection; + + /* + * Offline configuration. + */ + @JsonProperty(value = "offlineConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private SqlDbOfflineConfiguration offlineConfiguration; + + /* + * List of tables to copy. + */ + @JsonProperty(value = "tableList") + private List tableList; + + /* + * Database collation to be used for the target database. + */ + @JsonProperty(value = "targetDatabaseCollation") + private String targetDatabaseCollation; + + /* + * Error message for migration provisioning failure, if any. + */ + @JsonProperty(value = "provisioningError") + private String provisioningError; + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public SqlDbMigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the targetSqlConnection property: Target SQL DB connection details. + * + * @return the targetSqlConnection value. + */ + public SqlConnectionInformation targetSqlConnection() { + return this.targetSqlConnection; + } + + /** + * Set the targetSqlConnection property: Target SQL DB connection details. + * + * @param targetSqlConnection the targetSqlConnection value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withTargetSqlConnection(SqlConnectionInformation targetSqlConnection) { + this.targetSqlConnection = targetSqlConnection; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public SqlDbOfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Get the tableList property: List of tables to copy. + * + * @return the tableList value. + */ + public List tableList() { + return this.tableList; + } + + /** + * Set the tableList property: List of tables to copy. + * + * @param tableList the tableList value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withTableList(List tableList) { + this.tableList = tableList; + return this; + } + + /** + * Get the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @return the targetDatabaseCollation value. + */ + public String targetDatabaseCollation() { + return this.targetDatabaseCollation; + } + + /** + * Set the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @param targetDatabaseCollation the targetDatabaseCollation value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withTargetDatabaseCollation(String targetDatabaseCollation) { + this.targetDatabaseCollation = targetDatabaseCollation; + return this; + } + + /** + * Get the provisioningError property: Error message for migration provisioning failure, if any. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Set the provisioningError property: Error message for migration provisioning failure, if any. + * + * @param provisioningError the provisioningError value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withProvisioningError(String provisioningError) { + this.provisioningError = provisioningError; + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlDb withScope(String scope) { + super.withScope(scope); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlDb withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlDb withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlDb withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlDb withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (targetSqlConnection() != null) { + targetSqlConnection().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java new file mode 100644 index 0000000000000..92924f8c82bcb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Database Migration Resource properties for SQL Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SqlMi") +@Fluent +public final class DatabaseMigrationPropertiesSqlMi extends DatabaseMigrationProperties { + /* + * Detailed migration status. Not included by default. + */ + @JsonProperty(value = "migrationStatusDetails", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatusDetails migrationStatusDetails; + + /* + * Database collation to be used for the target database. + */ + @JsonProperty(value = "targetDatabaseCollation") + private String targetDatabaseCollation; + + /* + * Error message for migration provisioning failure, if any. + */ + @JsonProperty(value = "provisioningError") + private String provisioningError; + + /* + * Backup configuration info. + */ + @JsonProperty(value = "backupConfiguration") + private BackupConfiguration backupConfiguration; + + /* + * Offline configuration. + */ + @JsonProperty(value = "offlineConfiguration") + private OfflineConfiguration offlineConfiguration; + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public MigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @return the targetDatabaseCollation value. + */ + public String targetDatabaseCollation() { + return this.targetDatabaseCollation; + } + + /** + * Set the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @param targetDatabaseCollation the targetDatabaseCollation value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withTargetDatabaseCollation(String targetDatabaseCollation) { + this.targetDatabaseCollation = targetDatabaseCollation; + return this; + } + + /** + * Get the provisioningError property: Error message for migration provisioning failure, if any. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Set the provisioningError property: Error message for migration provisioning failure, if any. + * + * @param provisioningError the provisioningError value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withProvisioningError(String provisioningError) { + this.provisioningError = provisioningError; + return this; + } + + /** + * Get the backupConfiguration property: Backup configuration info. + * + * @return the backupConfiguration value. + */ + public BackupConfiguration backupConfiguration() { + return this.backupConfiguration; + } + + /** + * Set the backupConfiguration property: Backup configuration info. + * + * @param backupConfiguration the backupConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withBackupConfiguration(BackupConfiguration backupConfiguration) { + this.backupConfiguration = backupConfiguration; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public OfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Set the offlineConfiguration property: Offline configuration. + * + * @param offlineConfiguration the offlineConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withOfflineConfiguration(OfflineConfiguration offlineConfiguration) { + this.offlineConfiguration = offlineConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlMi withScope(String scope) { + super.withScope(scope); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlMi withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlMi withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlMi withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlMi withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (backupConfiguration() != null) { + backupConfiguration().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java new file mode 100644 index 0000000000000..bcac80a393f6d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Database Migration Resource properties for SQL Virtual Machine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SqlVm") +@Fluent +public final class DatabaseMigrationPropertiesSqlVm extends DatabaseMigrationProperties { + /* + * Detailed migration status. Not included by default. + */ + @JsonProperty(value = "migrationStatusDetails", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatusDetails migrationStatusDetails; + + /* + * Database collation to be used for the target database. + */ + @JsonProperty(value = "targetDatabaseCollation") + private String targetDatabaseCollation; + + /* + * Error message for migration provisioning failure, if any. + */ + @JsonProperty(value = "provisioningError") + private String provisioningError; + + /* + * Backup configuration info. + */ + @JsonProperty(value = "backupConfiguration") + private BackupConfiguration backupConfiguration; + + /* + * Offline configuration. + */ + @JsonProperty(value = "offlineConfiguration") + private OfflineConfiguration offlineConfiguration; + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public MigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @return the targetDatabaseCollation value. + */ + public String targetDatabaseCollation() { + return this.targetDatabaseCollation; + } + + /** + * Set the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @param targetDatabaseCollation the targetDatabaseCollation value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withTargetDatabaseCollation(String targetDatabaseCollation) { + this.targetDatabaseCollation = targetDatabaseCollation; + return this; + } + + /** + * Get the provisioningError property: Error message for migration provisioning failure, if any. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Set the provisioningError property: Error message for migration provisioning failure, if any. + * + * @param provisioningError the provisioningError value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withProvisioningError(String provisioningError) { + this.provisioningError = provisioningError; + return this; + } + + /** + * Get the backupConfiguration property: Backup configuration info. + * + * @return the backupConfiguration value. + */ + public BackupConfiguration backupConfiguration() { + return this.backupConfiguration; + } + + /** + * Set the backupConfiguration property: Backup configuration info. + * + * @param backupConfiguration the backupConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withBackupConfiguration(BackupConfiguration backupConfiguration) { + this.backupConfiguration = backupConfiguration; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public OfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Set the offlineConfiguration property: Offline configuration. + * + * @param offlineConfiguration the offlineConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withOfflineConfiguration(OfflineConfiguration offlineConfiguration) { + this.offlineConfiguration = offlineConfiguration; + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlVm withScope(String scope) { + super.withScope(scope); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlVm withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlVm withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlVm withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** {@inheritDoc} */ + @Override + public DatabaseMigrationPropertiesSqlVm withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (backupConfiguration() != null) { + backupConfiguration().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java new file mode 100644 index 0000000000000..4d3f67948ef30 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; + +/** An immutable client-side representation of DatabaseMigrationSqlDb. */ +public interface DatabaseMigrationSqlDb { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL database. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlDb properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlDbInner innerModel(); + + /** The entirety of the DatabaseMigrationSqlDb definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DatabaseMigrationSqlDb definition stages. */ + interface DefinitionStages { + /** The first stage of the DatabaseMigrationSqlDb definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DatabaseMigrationSqlDb definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sqlDbInstanceName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @return the next definition stage. + */ + WithCreate withExistingServer(String resourceGroupName, String sqlDbInstanceName); + } + /** + * The stage of the DatabaseMigrationSqlDb definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlDb create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlDb create(Context context); + } + /** The stage of the DatabaseMigrationSqlDb definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL database.. + * + * @param properties Database Migration Resource properties for SQL database. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlDb properties); + } + } + /** + * Begins update for the DatabaseMigrationSqlDb resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlDb.Update update(); + + /** The template for DatabaseMigrationSqlDb update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlDb apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlDb apply(Context context); + } + /** The DatabaseMigrationSqlDb update stages. */ + interface UpdateStages { + /** The stage of the DatabaseMigrationSqlDb update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL database.. + * + * @param properties Database Migration Resource properties for SQL database. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlDb properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlDb refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlDb refresh(Context context); + + /** + * Stop on going migration for the database. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java new file mode 100644 index 0000000000000..4d0cdfbf99f72 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; + +/** An immutable client-side representation of DatabaseMigrationSqlMi. */ +public interface DatabaseMigrationSqlMi { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlMi properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlMiInner innerModel(); + + /** The entirety of the DatabaseMigrationSqlMi definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DatabaseMigrationSqlMi definition stages. */ + interface DefinitionStages { + /** The first stage of the DatabaseMigrationSqlMi definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DatabaseMigrationSqlMi definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, managedInstanceName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @return the next definition stage. + */ + WithCreate withExistingManagedInstance(String resourceGroupName, String managedInstanceName); + } + /** + * The stage of the DatabaseMigrationSqlMi definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlMi create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlMi create(Context context); + } + /** The stage of the DatabaseMigrationSqlMi definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Managed Instance.. + * + * @param properties Database Migration Resource properties for SQL Managed Instance. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlMi properties); + } + } + /** + * Begins update for the DatabaseMigrationSqlMi resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlMi.Update update(); + + /** The template for DatabaseMigrationSqlMi update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlMi apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlMi apply(Context context); + } + /** The DatabaseMigrationSqlMi update stages. */ + interface UpdateStages { + /** The stage of the DatabaseMigrationSqlMi update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Managed Instance.. + * + * @param properties Database Migration Resource properties for SQL Managed Instance. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlMi properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlMi refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlMi refresh(Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java new file mode 100644 index 0000000000000..6c763b5827a53 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; + +/** An immutable client-side representation of DatabaseMigrationSqlVm. */ +public interface DatabaseMigrationSqlVm { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlVm properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlVmInner innerModel(); + + /** The entirety of the DatabaseMigrationSqlVm definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DatabaseMigrationSqlVm definition stages. */ + interface DefinitionStages { + /** The first stage of the DatabaseMigrationSqlVm definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DatabaseMigrationSqlVm definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sqlVirtualMachineName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @return the next definition stage. + */ + WithCreate withExistingSqlVirtualMachine(String resourceGroupName, String sqlVirtualMachineName); + } + /** + * The stage of the DatabaseMigrationSqlVm definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlVm create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlVm create(Context context); + } + /** The stage of the DatabaseMigrationSqlVm definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Virtual Machine.. + * + * @param properties Database Migration Resource properties for SQL Virtual Machine. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlVm properties); + } + } + /** + * Begins update for the DatabaseMigrationSqlVm resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlVm.Update update(); + + /** The template for DatabaseMigrationSqlVm update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlVm apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlVm apply(Context context); + } + /** The DatabaseMigrationSqlVm update stages. */ + interface UpdateStages { + /** The stage of the DatabaseMigrationSqlVm update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Virtual Machine.. + * + * @param properties Database Migration Resource properties for SQL Virtual Machine. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlVm properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlVm refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlVm refresh(Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java new file mode 100644 index 0000000000000..4f7571b237ba7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** Resource collection API of DatabaseMigrationsSqlDbs. */ +public interface DatabaseMigrationsSqlDbs { + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + DatabaseMigrationSqlDb get(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, + String sqlDbInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Retrieve the Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + DatabaseMigrationSqlDb getById(String id); + + /** + * Retrieve the Database Migration resource. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean force, Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlDb resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlDb definition. + */ + DatabaseMigrationSqlDb.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java new file mode 100644 index 0000000000000..37b42ca814659 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** Resource collection API of DatabaseMigrationsSqlMis. */ +public interface DatabaseMigrationsSqlMis { + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + DatabaseMigrationSqlMi get(String resourceGroupName, String managedInstanceName, String targetDbName); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover( + String resourceGroupName, String managedInstanceName, String targetDbName, MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover( + String resourceGroupName, + String managedInstanceName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + DatabaseMigrationSqlMi getById(String id); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlMi resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlMi definition. + */ + DatabaseMigrationSqlMi.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java new file mode 100644 index 0000000000000..3e367bdae3fdd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** Resource collection API of DatabaseMigrationsSqlVms. */ +public interface DatabaseMigrationsSqlVms { + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + DatabaseMigrationSqlVm get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + UUID migrationOperationId, + String expand, + Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Migration Operation Input. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover( + String resourceGroupName, + String sqlVirtualMachineName, + String targetDbName, + MigrationOperationInput parameters, + Context context); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + DatabaseMigrationSqlVm getById(String id); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or + * current operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + Response getByIdWithResponse( + String id, UUID migrationOperationId, String expand, Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlVm resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlVm definition. + */ + DatabaseMigrationSqlVm.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java index cba75a58e8be7..06492496f637f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Summary of database results in the migration. */ @Immutable public final class DatabaseSummaryResult extends DataItemMigrationSummaryResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseSummaryResult.class); - /* * Size of the database in megabytes */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java new file mode 100644 index 0000000000000..bc83d390f0ccb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Table properties. */ +@Immutable +public final class DatabaseTable { + /* + * Indicates whether table is empty or not + */ + @JsonProperty(value = "hasRows", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasRows; + + /* + * Schema-qualified name of the table + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the hasRows property: Indicates whether table is empty or not. + * + * @return the hasRows value. + */ + public Boolean hasRows() { + return this.hasRows; + } + + /** + * Get the name property: Schema-qualified name of the table. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java new file mode 100644 index 0000000000000..3c71f06ee1357 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; + +/** An immutable client-side representation of DeleteNode. */ +public interface DeleteNode { + /** + * Gets the nodeName property: The name of node to delete. + * + * @return the nodeName value. + */ + String nodeName(); + + /** + * Gets the integrationRuntimeName property: The name of integration runtime. + * + * @return the integrationRuntimeName value. + */ + String integrationRuntimeName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner object. + * + * @return the inner object. + */ + DeleteNodeInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java new file mode 100644 index 0000000000000..0552ae5e81547 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error details. */ +@Immutable +public final class ErrorInfo { + /* + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java deleted file mode 100644 index 1fbd7170eb446..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ErrorType. */ -public final class ErrorType extends ExpandableStringEnum { - /** Static value Default for ErrorType. */ - public static final ErrorType DEFAULT = fromString("Default"); - - /** Static value Warning for ErrorType. */ - public static final ErrorType WARNING = fromString("Warning"); - - /** Static value Error for ErrorType. */ - public static final ErrorType ERROR = fromString("Error"); - - /** - * Creates or finds a ErrorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ErrorType. - */ - @JsonCreator - public static ErrorType fromString(String name) { - return fromString(name, ErrorType.class); - } - - /** @return known ErrorType values. */ - public static Collection values() { - return values(ErrorType.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java index 2dede194c0d61..b73eeef608c3f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java @@ -5,8 +5,7 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -14,24 +13,22 @@ /** Description about the errors happen while performing migration validation. */ @Fluent public final class ExecutionStatistics { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExecutionStatistics.class); - /* * No. of query executions */ - @JsonProperty(value = "executionCount", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "executionCount") private Long executionCount; /* * CPU Time in millisecond(s) for the query execution */ - @JsonProperty(value = "cpuTimeMs", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "cpuTimeMs") private Float cpuTimeMs; /* * Time taken in millisecond(s) for executing the query */ - @JsonProperty(value = "elapsedTimeMs", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "elapsedTimeMs") private Float elapsedTimeMs; /* @@ -39,18 +36,19 @@ public final class ExecutionStatistics { * statistics */ @JsonProperty(value = "waitStats") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map waitStats; /* * Indicates whether the query resulted in an error */ - @JsonProperty(value = "hasErrors", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "hasErrors") private Boolean hasErrors; /* * List of sql Errors */ - @JsonProperty(value = "sqlErrors", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "sqlErrors") private List sqlErrors; /** @@ -62,6 +60,17 @@ public Long executionCount() { return this.executionCount; } + /** + * Set the executionCount property: No. of query executions. + * + * @param executionCount the executionCount value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withExecutionCount(Long executionCount) { + this.executionCount = executionCount; + return this; + } + /** * Get the cpuTimeMs property: CPU Time in millisecond(s) for the query execution. * @@ -71,6 +80,17 @@ public Float cpuTimeMs() { return this.cpuTimeMs; } + /** + * Set the cpuTimeMs property: CPU Time in millisecond(s) for the query execution. + * + * @param cpuTimeMs the cpuTimeMs value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withCpuTimeMs(Float cpuTimeMs) { + this.cpuTimeMs = cpuTimeMs; + return this; + } + /** * Get the elapsedTimeMs property: Time taken in millisecond(s) for executing the query. * @@ -80,6 +100,17 @@ public Float elapsedTimeMs() { return this.elapsedTimeMs; } + /** + * Set the elapsedTimeMs property: Time taken in millisecond(s) for executing the query. + * + * @param elapsedTimeMs the elapsedTimeMs value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withElapsedTimeMs(Float elapsedTimeMs) { + this.elapsedTimeMs = elapsedTimeMs; + return this; + } + /** * Get the waitStats property: Dictionary of sql query execution wait types and the respective statistics. * @@ -109,6 +140,17 @@ public Boolean hasErrors() { return this.hasErrors; } + /** + * Set the hasErrors property: Indicates whether the query resulted in an error. + * + * @param hasErrors the hasErrors value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withHasErrors(Boolean hasErrors) { + this.hasErrors = hasErrors; + return this; + } + /** * Get the sqlErrors property: List of sql Errors. * @@ -118,6 +160,17 @@ public List sqlErrors() { return this.sqlErrors; } + /** + * Set the sqlErrors property: List of sql Errors. + * + * @param sqlErrors the sqlErrors value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withSqlErrors(List sqlErrors) { + this.sqlErrors = sqlErrors; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java similarity index 53% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java index 92399a3096450..22bf9f354780d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java @@ -5,51 +5,47 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** OData page of action (operation) objects. */ +/** OData page of files. */ @Fluent -public final class ServiceOperationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationList.class); - +public final class FileList { /* - * List of actions + * List of files */ @JsonProperty(value = "value") - private List value; + private List value; /* - * URL to load the next page of actions + * URL to load the next page of files */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: List of actions. + * Get the value property: List of files. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of actions. + * Set the value property: List of files. * * @param value the value value to set. - * @return the ServiceOperationList object itself. + * @return the FileList object itself. */ - public ServiceOperationList withValue(List value) { + public FileList withValue(List value) { this.value = value; return this; } /** - * Get the nextLink property: URL to load the next page of actions. + * Get the nextLink property: URL to load the next page of files. * * @return the nextLink value. */ @@ -58,12 +54,12 @@ public String nextLink() { } /** - * Set the nextLink property: URL to load the next page of actions. + * Set the nextLink property: URL to load the next page of files. * * @param nextLink the nextLink value to set. - * @return the ServiceOperationList object itself. + * @return the FileList object itself. */ - public ServiceOperationList withNextLink(String nextLink) { + public FileList withNextLink(String nextLink) { this.nextLink = nextLink; return this; } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java index e9a7d20eb6757..f2716b9df53d5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** File share information with Path, Username, and Password. */ @Fluent public final class FileShare { - @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShare.class); - /* * User name credential to connect to the share location */ @@ -99,8 +96,10 @@ public FileShare withPath(String path) { */ public void validate() { if (path() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property path in model FileShare")); } } + + private static final ClientLogger LOGGER = new ClientLogger(FileShare.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java new file mode 100644 index 0000000000000..658db604dec37 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import java.util.Map; + +/** An immutable client-side representation of FileStorageInfo. */ +public interface FileStorageInfo { + /** + * Gets the uri property: A URI that can be used to access the file content. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the headers property: Dictionary of <string>. + * + * @return the headers value. + */ + Map headers(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner object. + * + * @return the inner object. + */ + FileStorageInfoInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java new file mode 100644 index 0000000000000..8f74e2c8a9e1c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Files. */ +public interface Files { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + ProjectFile get(String groupName, String serviceName, String projectName, String fileName); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo read(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo readWrite(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + ProjectFile getById(String id); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * This method deletes a file. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * This method deletes a file. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProjectFile resource. + * + * @param name resource name. + * @return the first stage of the new ProjectFile definition. + */ + ProjectFile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java index d14cd4744e578..ffca7cd31490b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that gets TDE certificates in Base64 encoded format. */ @Fluent public final class GetTdeCertificatesSqlTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskInput.class); - /* * Connection information for SQL Server */ @@ -107,7 +104,7 @@ public GetTdeCertificatesSqlTaskInput withSelectedCertificates( */ public void validate() { if (connectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property connectionInfo in model GetTdeCertificatesSqlTaskInput")); @@ -115,7 +112,7 @@ public void validate() { connectionInfo().validate(); } if (backupFileShare() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupFileShare in model GetTdeCertificatesSqlTaskInput")); @@ -123,7 +120,7 @@ public void validate() { backupFileShare().validate(); } if (selectedCertificates() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedCertificates in model GetTdeCertificatesSqlTaskInput")); @@ -131,4 +128,6 @@ public void validate() { selectedCertificates().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(GetTdeCertificatesSqlTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java index 9f60afa9dba2d..19682f4ef791b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output of the task that gets TDE certificates in Base64 encoded format. */ @Immutable public final class GetTdeCertificatesSqlTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskOutput.class); - /* * Mapping from certificate name to base 64 encoded format. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java index 34b44e3a61c6a..24d7ae19df885 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that gets TDE certificates in Base64 encoded format. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("GetTDECertificates.Sql") @Fluent public final class GetTdeCertificatesSqlTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public GetTdeCertificatesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java new file mode 100644 index 0000000000000..198c219aaece0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for the task that collects user tables for the given list of databases. */ +@Fluent +public final class GetUserTablesMySqlTaskInput { + /* + * Connection information for SQL Server + */ + @JsonProperty(value = "connectionInfo", required = true) + private MySqlConnectionInfo connectionInfo; + + /* + * List of database names to collect tables for + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the connectionInfo property: Connection information for SQL Server. + * + * @return the connectionInfo value. + */ + public MySqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesMySqlTaskInput object itself. + */ + public GetUserTablesMySqlTaskInput withConnectionInfo(MySqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: List of database names to collect tables for. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: List of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the GetUserTablesMySqlTaskInput object itself. + */ + public GetUserTablesMySqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesMySqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesMySqlTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesMySqlTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java new file mode 100644 index 0000000000000..b7c3eb2bcf0f2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output of the task that collects user tables for the given list of databases. */ +@Immutable +public final class GetUserTablesMySqlTaskOutput { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Mapping from database name to list of tables + */ + @JsonProperty(value = "databasesToTables", access = JsonProperty.Access.WRITE_ONLY) + private String databasesToTables; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the databasesToTables property: Mapping from database name to list of tables. + * + * @return the databasesToTables value. + */ + public String databasesToTables() { + return this.databasesToTables; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java new file mode 100644 index 0000000000000..f62c76e3713d2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesMySql") +@Fluent +public final class GetUserTablesMySqlTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesMySqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesMySqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesMySqlTaskProperties object itself. + */ + public GetUserTablesMySqlTaskProperties withInput(GetUserTablesMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java new file mode 100644 index 0000000000000..13819cd8ecb1f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for the task that gets the list of tables contained within a provided list of Oracle schemas. */ +@Fluent +public final class GetUserTablesOracleTaskInput { + /* + * Information for connecting to Oracle source + */ + @JsonProperty(value = "connectionInfo", required = true) + private OracleConnectionInfo connectionInfo; + + /* + * List of Oracle schemas for which to collect tables + */ + @JsonProperty(value = "selectedSchemas", required = true) + private List selectedSchemas; + + /** + * Get the connectionInfo property: Information for connecting to Oracle source. + * + * @return the connectionInfo value. + */ + public OracleConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Information for connecting to Oracle source. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesOracleTaskInput object itself. + */ + public GetUserTablesOracleTaskInput withConnectionInfo(OracleConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedSchemas property: List of Oracle schemas for which to collect tables. + * + * @return the selectedSchemas value. + */ + public List selectedSchemas() { + return this.selectedSchemas; + } + + /** + * Set the selectedSchemas property: List of Oracle schemas for which to collect tables. + * + * @param selectedSchemas the selectedSchemas value to set. + * @return the GetUserTablesOracleTaskInput object itself. + */ + public GetUserTablesOracleTaskInput withSelectedSchemas(List selectedSchemas) { + this.selectedSchemas = selectedSchemas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesOracleTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedSchemas() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedSchemas in model GetUserTablesOracleTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesOracleTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java new file mode 100644 index 0000000000000..ebc36b946bb71 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the task that gets the list of tables contained within a provided list of Oracle schemas. */ +@Immutable +public final class GetUserTablesOracleTaskOutput { + /* + * The schema this result is for + */ + @JsonProperty(value = "schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /* + * List of valid tables found for this schema + */ + @JsonProperty(value = "tables", access = JsonProperty.Access.WRITE_ONLY) + private List tables; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the schemaName property: The schema this result is for. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get the tables property: List of valid tables found for this schema. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java new file mode 100644 index 0000000000000..f440f05f03dc3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of Oracle schemas. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesOracle") +@Fluent +public final class GetUserTablesOracleTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesOracleTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesOracleTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesOracleTaskProperties object itself. + */ + public GetUserTablesOracleTaskProperties withInput(GetUserTablesOracleTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesOracleTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java new file mode 100644 index 0000000000000..0db185d6ebddf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for the task that gets the list of tables for a provided list of PostgreSQL databases. */ +@Fluent +public final class GetUserTablesPostgreSqlTaskInput { + /* + * Information for connecting to PostgreSQL source + */ + @JsonProperty(value = "connectionInfo", required = true) + private PostgreSqlConnectionInfo connectionInfo; + + /* + * List of PostgreSQL databases for which to collect tables + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the connectionInfo property: Information for connecting to PostgreSQL source. + * + * @return the connectionInfo value. + */ + public PostgreSqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Information for connecting to PostgreSQL source. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesPostgreSqlTaskInput object itself. + */ + public GetUserTablesPostgreSqlTaskInput withConnectionInfo(PostgreSqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: List of PostgreSQL databases for which to collect tables. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: List of PostgreSQL databases for which to collect tables. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the GetUserTablesPostgreSqlTaskInput object itself. + */ + public GetUserTablesPostgreSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesPostgreSqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesPostgreSqlTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesPostgreSqlTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java new file mode 100644 index 0000000000000..5e24dea77844b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the task that gets the list of tables for a provided list of PostgreSQL databases. */ +@Immutable +public final class GetUserTablesPostgreSqlTaskOutput { + /* + * The database this result is for + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * List of valid tables found for this database + */ + @JsonProperty(value = "tables", access = JsonProperty.Access.WRITE_ONLY) + private List tables; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the databaseName property: The database this result is for. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the tables property: List of valid tables found for this database. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java new file mode 100644 index 0000000000000..0655d90b87720 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesPostgreSql") +@Fluent +public final class GetUserTablesPostgreSqlTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesPostgreSqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesPostgreSqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesPostgreSqlTaskProperties object itself. + */ + public GetUserTablesPostgreSqlTaskProperties withInput(GetUserTablesPostgreSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesPostgreSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java index dc435193f8621..553d7f7aeb688 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that collects user tables for the given list of databases. */ @Fluent public final class GetUserTablesSqlSyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskInput.class); - /* * Connection information for SQL Server */ @@ -126,7 +123,7 @@ public GetUserTablesSqlSyncTaskInput withSelectedTargetDatabases(List se */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model GetUserTablesSqlSyncTaskInput")); @@ -134,7 +131,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model GetUserTablesSqlSyncTaskInput")); @@ -142,16 +139,18 @@ public void validate() { targetConnectionInfo().validate(); } if (selectedSourceDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedSourceDatabases in model GetUserTablesSqlSyncTaskInput")); } if (selectedTargetDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedTargetDatabases in model GetUserTablesSqlSyncTaskInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesSqlSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java index 3b76ecd344d2d..858a25c3bcdc0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output of the task that collects user tables for the given list of databases. */ @Immutable public final class GetUserTablesSqlSyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskOutput.class); - /* * Mapping from database name to list of source tables */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java index 66edd726e08cd..88e7d42b8d1db 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that collects user tables for the given list of databases. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("GetUserTables.AzureSqlDb.Sync") @Fluent public final class GetUserTablesSqlSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public GetUserTablesSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java index 50a2d6a292eb8..da50de479fe90 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that collects user tables for the given list of databases. */ @Fluent public final class GetUserTablesSqlTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskInput.class); - /* * Connection information for SQL Server */ @@ -27,6 +24,12 @@ public final class GetUserTablesSqlTaskInput { @JsonProperty(value = "selectedDatabases", required = true) private List selectedDatabases; + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + /** * Get the connectionInfo property: Connection information for SQL Server. * @@ -67,6 +70,26 @@ public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedData return this; } + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * Validates the instance. * @@ -74,7 +97,7 @@ public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedData */ public void validate() { if (connectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property connectionInfo in model GetUserTablesSqlTaskInput")); @@ -82,10 +105,12 @@ public void validate() { connectionInfo().validate(); } if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model GetUserTablesSqlTaskInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesSqlTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java index 91208c5eaee7a..4fe55fd555d07 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output of the task that collects user tables for the given list of databases. */ @Immutable public final class GetUserTablesSqlTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java index 151d5e9e0aa90..064ef65343615 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that collects user tables for the given list of databases. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("GetUserTables.Sql") @Fluent public final class GetUserTablesSqlTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskProperties.class); - /* * Task input */ @@ -31,6 +28,12 @@ public final class GetUserTablesSqlTaskProperties extends ProjectTaskProperties @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * Task id + */ + @JsonProperty(value = "taskId") + private String taskId; + /** * Get the input property: Task input. * @@ -60,6 +63,33 @@ public List output() { return this.output; } + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java new file mode 100644 index 0000000000000..9bad40192b7c2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to install an OCI driver. */ +@Fluent +public final class InstallOciDriverTaskInput { + /* + * Name of the uploaded driver package to install. + */ + @JsonProperty(value = "driverPackageName") + private String driverPackageName; + + /** + * Get the driverPackageName property: Name of the uploaded driver package to install. + * + * @return the driverPackageName value. + */ + public String driverPackageName() { + return this.driverPackageName; + } + + /** + * Set the driverPackageName property: Name of the uploaded driver package to install. + * + * @param driverPackageName the driverPackageName value to set. + * @return the InstallOciDriverTaskInput object itself. + */ + public InstallOciDriverTaskInput withDriverPackageName(String driverPackageName) { + this.driverPackageName = driverPackageName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java new file mode 100644 index 0000000000000..e55a5eec3ec5c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the service task to install an OCI driver. */ +@Immutable +public final class InstallOciDriverTaskOutput { + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java new file mode 100644 index 0000000000000..3b3f52bd306e5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that installs an OCI driver. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Install.OCI") +@Fluent +public final class InstallOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Input for the service task to install an OCI driver. + */ + @JsonProperty(value = "input") + private InstallOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to install an OCI driver. + * + * @return the input value. + */ + public InstallOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to install an OCI driver. + * + * @param input the input value to set. + * @return the InstallOciDriverTaskProperties object itself. + */ + public InstallOciDriverTaskProperties withInput(InstallOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public InstallOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java new file mode 100644 index 0000000000000..0dba1306f408d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import java.util.List; + +/** An immutable client-side representation of IntegrationRuntimeMonitoringData. */ +public interface IntegrationRuntimeMonitoringData { + /** + * Gets the name property: The name of Integration Runtime. + * + * @return the name value. + */ + String name(); + + /** + * Gets the nodes property: Integration Runtime node monitoring data. + * + * @return the nodes value. + */ + List nodes(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner + * object. + * + * @return the inner object. + */ + IntegrationRuntimeMonitoringDataInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java index 7e04a1c070935..b27c0c2c54458 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("MiSqlConnectionInfo") @Fluent public final class MiSqlConnectionInfo extends ConnectionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MiSqlConnectionInfo.class); - /* * Resource id for Azure SQL database Managed instance */ @@ -67,10 +64,12 @@ public MiSqlConnectionInfo withPassword(String password) { public void validate() { super.validate(); if (managedInstanceResourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property managedInstanceResourceId in model MiSqlConnectionInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(MiSqlConnectionInfo.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java index af024eb545cc5..cec380e4c0bb2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input for command that completes online migration for an Azure SQL Database Managed Instance. */ @Fluent public final class MigrateMISyncCompleteCommandInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandInput.class); - /* * Name of managed instance database */ @@ -47,10 +44,12 @@ public MigrateMISyncCompleteCommandInput withSourceDatabaseName(String sourceDat */ public void validate() { if (sourceDatabaseName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceDatabaseName in model MigrateMISyncCompleteCommandInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateMISyncCompleteCommandInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java index a1abb17844ab9..9666accf1c9ab 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for command that completes online migration for an Azure SQL Database Managed Instance. */ @Fluent public final class MigrateMISyncCompleteCommandOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandOutput.class); - /* * List of errors that happened during the command execution */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java index 3421f0b1b1616..b10a57e5630e5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java @@ -5,8 +5,7 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -15,9 +14,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") @JsonTypeName("Migrate.SqlServer.AzureDbSqlMi.Complete") @Fluent -public final class MigrateMISyncCompleteCommandProperties extends CommandProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandProperties.class); - +public final class MigrateMISyncCompleteCommandProperties extends CommandPropertiesInner { /* * Command input */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java new file mode 100644 index 0000000000000..1f1ca477e52b0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates data between MongoDB data sources. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MongoDb") +@Fluent +public final class MigrateMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Describes how a MongoDB data migration should be performed + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /* + * The output property. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes how a MongoDB data migration should be performed. + * + * @return the input value. + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input property: Describes how a MongoDB data migration should be performed. + * + * @param input the input value to set. + * @return the MigrateMongoDbTaskProperties object itself. + */ + public MigrateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get the output property: The output property. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java new file mode 100644 index 0000000000000..7a9c569cc19a9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Database specific information for offline MySQL to Azure Database for MySQL migration task inputs. */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput { + /* + * Name of the database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tableMap; + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java new file mode 100644 index 0000000000000..97eee584f84ab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskInput { + /* + * Connection information for source MySQL + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target Azure Database for MySQL + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MySqlConnectionInfo targetConnectionInfo; + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Setting to set the source server read only + */ + @JsonProperty(value = "makeSourceServerReadOnly") + private Boolean makeSourceServerReadOnly; + + /* + * Parameter to specify when the migration started + */ + @JsonProperty(value = "startedOn") + private OffsetDateTime startedOn; + + /* + * Optional parameters for fine tuning the data transfer rate during + * migration + */ + @JsonProperty(value = "optionalAgentSettings") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map optionalAgentSettings; + + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + + /** + * Get the sourceConnectionInfo property: Connection information for source MySQL. + * + * @return the sourceConnectionInfo value. + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source MySQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withSourceConnectionInfo( + MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @return the targetConnectionInfo value. + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withTargetConnectionInfo( + MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the makeSourceServerReadOnly property: Setting to set the source server read only. + * + * @return the makeSourceServerReadOnly value. + */ + public Boolean makeSourceServerReadOnly() { + return this.makeSourceServerReadOnly; + } + + /** + * Set the makeSourceServerReadOnly property: Setting to set the source server read only. + * + * @param makeSourceServerReadOnly the makeSourceServerReadOnly value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withMakeSourceServerReadOnly(Boolean makeSourceServerReadOnly) { + this.makeSourceServerReadOnly = makeSourceServerReadOnly; + return this; + } + + /** + * Get the startedOn property: Parameter to specify when the migration started. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Parameter to specify when the migration started. + * + * @param startedOn the startedOn value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the optionalAgentSettings property: Optional parameters for fine tuning the data transfer rate during + * migration. + * + * @return the optionalAgentSettings value. + */ + public Map optionalAgentSettings() { + return this.optionalAgentSettings; + } + + /** + * Set the optionalAgentSettings property: Optional parameters for fine tuning the data transfer rate during + * migration. + * + * @param optionalAgentSettings the optionalAgentSettings value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withOptionalAgentSettings( + Map optionalAgentSettings) { + this.optionalAgentSettings = optionalAgentSettings; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withEncryptedKeyForSecureFields( + String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java new file mode 100644 index 0000000000000..7232d5d1ea0c1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateMySqlAzureDbForMySqlOfflineTaskOutput.class) +@JsonTypeName("MigrateMySqlAzureDbForMySqlOfflineTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.class), + @JsonSubTypes.Type( + name = "DatabaseLevelOutput", + value = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.class) +}) +@Immutable +public class MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..78fb36fbc9a97 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration stage that this database is in + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /* + * Status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Number of objects + */ + @JsonProperty(value = "numberOfObjects", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjects; + + /* + * Number of successfully completed objects + */ + @JsonProperty(value = "numberOfObjectsCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjectsCompleted; + + /* + * Number of database/object errors. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long errorCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the + * item + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /* + * Last time the storage was updated + */ + @JsonProperty(value = "lastStorageUpdate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStorageUpdate; + + /* + * Summary of object results in the migration + */ + @JsonProperty(value = "objectSummary", access = JsonProperty.Access.WRITE_ONLY) + private String objectSummary; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Migration stage that this database is in. + * + * @return the stage value. + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the numberOfObjects property: Number of objects. + * + * @return the numberOfObjects value. + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get the numberOfObjectsCompleted property: Number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value. + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get the errorCount property: Number of database/object errors. + * + * @return the errorCount value. + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Get the objectSummary property: Summary of object results in the migration. + * + * @return the objectSummary value. + */ + public String objectSummary() { + return this.objectSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java new file mode 100644 index 0000000000000..bfc774e49a7e1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..e1b6d906dcc44 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Duration of task execution in seconds. + */ + @JsonProperty(value = "durationInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long durationInSeconds; + + /* + * Current status of migration + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /* + * Migration status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Selected databases as a map from database name to database id + */ + @JsonProperty(value = "databases") + private String databases; + + /* + * Summary of database results in the migration + */ + @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) + private String databaseSummary; + + /* + * Migration Report Result, provides unique url for downloading your + * migration report. + */ + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /* + * Last time the storage was updated + */ + @JsonProperty(value = "lastStorageUpdate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStorageUpdate; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the durationInSeconds property: Duration of task execution in seconds. + * + * @return the durationInSeconds value. + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the statusMessage property: Migration status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the databases property: Selected databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Set the databases property: Selected databases as a map from database name to database id. + * + * @param databases the databases value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel withDatabases(String databases) { + this.databases = databases; + return this; + } + + /** + * Get the databaseSummary property: Summary of database results in the migration. + * + * @return the databaseSummary value. + */ + public String databaseSummary() { + return this.databaseSummary; + } + + /** + * Get the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @return the migrationReportResult value. + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @param migrationReportResult the migrationReportResult value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel withMigrationReportResult( + MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationReportResult() != null) { + migrationReportResult().validate(); + } + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java new file mode 100644 index 0000000000000..3d1925aaeacf8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Name of the item + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Number of items + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /* + * Number of successfully completed items + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the + * item + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /* + * Last time the storage was updated + */ + @JsonProperty(value = "lastStorageUpdate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStorageUpdate; + + /** + * Get the objectName property: Name of the item. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the itemsCount property: Number of items. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get the itemsCompletedCount property: Number of successfully completed items. + * + * @return the itemsCompletedCount value. + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java new file mode 100644 index 0000000000000..3c17e20e21b05 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MySql.AzureDbForMySql") +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateMySqlAzureDbForMySqlOfflineTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /* + * whether the task can be cloned or not + */ + @JsonProperty(value = "isCloneable") + private Boolean isCloneable; + + /* + * Task id + */ + @JsonProperty(value = "taskId") + private String taskId; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withInput( + MigrateMySqlAzureDbForMySqlOfflineTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java index 3a6a4bc75b42d..2441238957e97 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Database specific information for MySQL to Azure Database for MySQL migration task inputs. */ @Fluent public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncDatabaseInput.class); - /* * Name of the database */ @@ -33,20 +29,30 @@ public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { * Migration settings which tune the migration behavior */ @JsonProperty(value = "migrationSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map migrationSetting; /* * Source settings to tune source endpoint migration behavior */ @JsonProperty(value = "sourceSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceSetting; /* * Target settings to tune target endpoint migration behavior */ @JsonProperty(value = "targetSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map targetSetting; + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tableMap; + /** * Get the name property: Name of the database. * @@ -149,6 +155,26 @@ public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTargetSetting(Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java index 2e3210a141b9b..cb246cb0e4f15 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. */ @Fluent public final class MigrateMySqlAzureDbForMySqlSyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskInput.class); - /* * Connection information for source MySQL */ @@ -101,7 +98,7 @@ public MigrateMySqlAzureDbForMySqlSyncTaskInput withSelectedDatabases( */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -110,7 +107,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -119,7 +116,7 @@ public void validate() { targetConnectionInfo().validate(); } if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model" @@ -128,4 +125,6 @@ public void validate() { selectedDatabases().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java index fcd30f6421659..7a219ce81df24 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -34,8 +32,6 @@ }) @Immutable public class MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java index a931f2fae2c8f..9f4d23dc4ea38 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @Fluent public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class); - /* * Error message */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java index 816633abd6375..3ddf68aa26607 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @Immutable public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java index 6ca14d3c0302e..da54154e49146 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,9 +14,6 @@ @JsonTypeName("ErrorOutput") @Immutable public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class); - /* * Migration error */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java index 21b3ea1396f47..7aa0c9c2f63ae 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @Immutable public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class); - /* * Migration start time */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java index c4e50b1707da0..ae39fedc62ccd 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @Immutable public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class); - /* * Name of the table */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java index 5d92873f0f5ba..3b8967fb618cc 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("Migrate.MySql.AzureDbForMySql.Sync") @Fluent public final class MigrateMySqlAzureDbForMySqlSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskProperties.class); - /* * Task input */ @@ -61,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public MigrateMySqlAzureDbForMySqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 0000000000000..829834d14f464 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.Oracle.AzureDbForPostgreSql.Sync") +@Fluent +public final class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + MigrateOracleAzureDbPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java new file mode 100644 index 0000000000000..ee0c31e2d2466 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs. */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput { + /* + * How to handle object name casing: either Preserve or ToLower + */ + @JsonProperty(value = "caseManipulation") + private String caseManipulation; + + /* + * Name of the migration pipeline + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of the source schema + */ + @JsonProperty(value = "schemaName") + private String schemaName; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tableMap; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Migration settings which tune the migration behavior + */ + @JsonProperty(value = "migrationSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map targetSetting; + + /** + * Get the caseManipulation property: How to handle object name casing: either Preserve or ToLower. + * + * @return the caseManipulation value. + */ + public String caseManipulation() { + return this.caseManipulation; + } + + /** + * Set the caseManipulation property: How to handle object name casing: either Preserve or ToLower. + * + * @param caseManipulation the caseManipulation value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withCaseManipulation(String caseManipulation) { + this.caseManipulation = caseManipulation; + return this; + } + + /** + * Get the name property: Name of the migration pipeline. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the migration pipeline. + * + * @param name the name value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the schemaName property: Name of the source schema. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set the schemaName property: Name of the source schema. + * + * @param schemaName the schemaName value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the migrationSetting property: Migration settings which tune the migration behavior. + * + * @return the migrationSetting value. + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set the migrationSetting property: Migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withMigrationSetting(Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value. + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value. + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java new file mode 100644 index 0000000000000..328d87ca9a0ac --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncTaskInput { + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Connection information for target Azure Database for PostgreSQL + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /* + * Connection information for source Oracle + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the sourceConnectionInfo property: Connection information for source Oracle. + * + * @return the sourceConnectionInfo value. + */ + public OracleConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source Oracle. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withSourceConnectionInfo( + OracleConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedDatabases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (targetConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (sourceConnectionInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java new file mode 100644 index 0000000000000..f084f3f975d35 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateOracleAzureDbPostgreSqlSyncTaskOutput.class) +@JsonTypeName("MigrateOracleAzureDbPostgreSqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type( + name = "DatabaseLevelOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.class), + @JsonSubTypes.Type( + name = "DatabaseLevelErrorOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.class) +}) +@Immutable +public class MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java new file mode 100644 index 0000000000000..438146592759b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError withEvents( + List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..2ec2054288696 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /* + * Number of applied changes + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the migrationState property: Migration state that this database is in. + * + * @return the migrationState value. + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get the incomingChanges property: Number of incoming changes. + * + * @return the incomingChanges value. + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get the appliedChanges property: Number of applied changes. + * + * @return the appliedChanges value. + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get the cdcInsertCounter property: Number of cdc inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of cdc deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of cdc updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables completed in full load. + * + * @return the fullLoadCompletedTables value. + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading in full load. + * + * @return the fullLoadLoadingTables value. + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued in full load. + * + * @return the fullLoadQueuedTables value. + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored in full load. + * + * @return the fullLoadErroredTables value. + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get the initializationCompleted property: Indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value. + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get the latency property: CDC apply latency. + * + * @return the latency value. + */ + public Long latency() { + return this.latency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java new file mode 100644 index 0000000000000..c6bd7567d3b79 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..0f7945f6115df --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServer property: Source server name. + * + * @return the sourceServer value. + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServer property: Target server name. + * + * @return the targetServer value. + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java new file mode 100644 index 0000000000000..359cb6ee56d55 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Name of the table + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Number of applied inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of applied updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of applied deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /** + * Get the tableName property: Name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the cdcInsertCounter property: Number of applied inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of applied updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of applied deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the fullLoadEstFinishTime property: Estimate to finish full load. + * + * @return the fullLoadEstFinishTime value. + */ + public OffsetDateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get the fullLoadStartedOn property: Full load start time. + * + * @return the fullLoadStartedOn value. + */ + public OffsetDateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get the fullLoadEndedOn property: Full load end time. + * + * @return the fullLoadEndedOn value. + */ + public OffsetDateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get the fullLoadTotalRows property: Number of rows applied in full load. + * + * @return the fullLoadTotalRows value. + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get the state property: Current state of the table migration. + * + * @return the state value. + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get the totalChangesApplied property: Total number of applied changes. + * + * @return the totalChangesApplied value. + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get the dataErrorsCounter property: Number of data errors occurred. + * + * @return the dataErrorsCounter value. + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get the lastModifiedTime property: Last modified time on target. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java index c6124e31a0bcb..b522307721346 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs. */ @Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.class); - /* * Name of the database */ @JsonProperty(value = "name") private String name; + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + /* * Name of target database. Note: Target database will be truncated before * starting migration. @@ -33,20 +36,29 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { * Migration settings which tune the migration behavior */ @JsonProperty(value = "migrationSetting") - private Map migrationSetting; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map migrationSetting; /* * Source settings to tune source endpoint migration behavior */ @JsonProperty(value = "sourceSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceSetting; /* * Target settings to tune target endpoint migration behavior */ @JsonProperty(value = "targetSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map targetSetting; + /* + * Tables selected for migration + */ + @JsonProperty(value = "selectedTables") + private List selectedTables; + /** * Get the name property: Name of the database. * @@ -67,6 +79,15 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withName(String na return this; } + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + /** * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before * starting migration. @@ -94,7 +115,7 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetDatabase * * @return the migrationSetting value. */ - public Map migrationSetting() { + public Map migrationSetting() { return this.migrationSetting; } @@ -105,7 +126,7 @@ public Map migrationSetting() { * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. */ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withMigrationSetting( - Map migrationSetting) { + Map migrationSetting) { this.migrationSetting = migrationSetting; return this; } @@ -150,11 +171,35 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetSetting( return this; } + /** + * Get the selectedTables property: Tables selected for migration. + * + * @return the selectedTables value. + */ + public List selectedTables() { + return this.selectedTables; + } + + /** + * Set the selectedTables property: Tables selected for migration. + * + * @param selectedTables the selectedTables value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withSelectedTables( + List selectedTables) { + this.selectedTables = selectedTables; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (selectedTables() != null) { + selectedTables().forEach(e -> e.validate()); + } } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java new file mode 100644 index 0000000000000..ae19152a5d827 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Selected tables for the migration. */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput { + /* + * Name of the table to migrate + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Name of the table to migrate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the table to migrate. + * + * @param name the name value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java index adab2a9383fd5..11b93f4b38d1e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java @@ -6,16 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import java.util.List; /** Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. */ @Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.class); - /* * Databases to migrate */ @@ -34,6 +31,18 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { @JsonProperty(value = "sourceConnectionInfo", required = true) private PostgreSqlConnectionInfo sourceConnectionInfo; + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + /** * Get the selectedDatabases property: Databases to migrate. * @@ -97,6 +106,36 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSourceConnectionIn return this; } + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withEncryptedKeyForSecureFields( + String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + /** * Validates the instance. * @@ -104,7 +143,7 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSourceConnectionIn */ public void validate() { if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model" @@ -113,7 +152,7 @@ public void validate() { selectedDatabases().forEach(e -> e.validate()); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -122,7 +161,7 @@ public void validate() { targetConnectionInfo().validate(); } if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -131,4 +170,7 @@ public void validate() { sourceConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java index 940950ba54ce9..c00f835c345ee 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -36,9 +34,6 @@ }) @Immutable public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java index b9a4a86a0c8d7..b7a5013c980a5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,10 +16,6 @@ @Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class); - /* * Error message */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java index 6d3bf92b6a026..7a6d80dcfe04f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,10 +16,6 @@ @Immutable public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java index 2ee7ea9ededd6..bcc29cd843876 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java @@ -4,29 +4,30 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("ErrorOutput") -@Immutable +@Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class); - /* * Migration error */ @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) private ReportableException error; + /* + * List of error events + */ + @JsonProperty(value = "events") + private List events; + /** * Get the error property: Migration error. * @@ -36,6 +37,27 @@ public ReportableException error() { return this.error; } + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError withEvents( + List events) { + this.events = events; + return this; + } + /** * Validates the instance. * @@ -47,5 +69,8 @@ public void validate() { if (error() != null) { error().validate(); } + if (events() != null) { + events().forEach(e -> e.validate()); + } } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java index 0e25dbdb56f59..eebbe1ae4585e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java @@ -4,9 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -15,13 +13,9 @@ /** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("MigrationLevelOutput") -@Immutable +@Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class); - /* * Migration start time */ @@ -58,6 +52,30 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationL @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) private String targetServer; + /* + * Source server type. + */ + @JsonProperty(value = "sourceServerType", access = JsonProperty.Access.WRITE_ONLY) + private ScenarioSource sourceServerType; + + /* + * Target server type. + */ + @JsonProperty(value = "targetServerType", access = JsonProperty.Access.WRITE_ONLY) + private ScenarioTarget targetServerType; + + /* + * Migration status + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ReplicateMigrationState state; + + /* + * Number of databases to include + */ + @JsonProperty(value = "databaseCount") + private Float databaseCount; + /** * Get the startedOn property: Migration start time. * @@ -112,6 +130,53 @@ public String targetServer() { return this.targetServer; } + /** + * Get the sourceServerType property: Source server type. + * + * @return the sourceServerType value. + */ + public ScenarioSource sourceServerType() { + return this.sourceServerType; + } + + /** + * Get the targetServerType property: Target server type. + * + * @return the targetServerType value. + */ + public ScenarioTarget targetServerType() { + return this.targetServerType; + } + + /** + * Get the state property: Migration status. + * + * @return the state value. + */ + public ReplicateMigrationState state() { + return this.state; + } + + /** + * Get the databaseCount property: Number of databases to include. + * + * @return the databaseCount value. + */ + public Float databaseCount() { + return this.databaseCount; + } + + /** + * Set the databaseCount property: Number of databases to include. + * + * @param databaseCount the databaseCount value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel withDatabaseCount(Float databaseCount) { + this.databaseCount = databaseCount; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java index d99a9f10eb080..176f9fdef33d7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,10 +16,6 @@ @Immutable public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class); - /* * Name of the table */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java index cb2a0c76724a5..49fb4354158cf 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java @@ -5,23 +5,19 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** * Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") -@JsonTypeName("Migrate.PostgreSql.AzureDbForPostgreSql.Sync") +@JsonTypeName("Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") @Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class); - /* * Task input */ @@ -34,6 +30,24 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties exten @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * task id + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + + /* + * whether the task can be cloned or not + */ + @JsonProperty(value = "isCloneable") + private Boolean isCloneable; + /** * Get the input property: Task input. * @@ -64,6 +78,73 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java new file mode 100644 index 0000000000000..1442b9afb0c2e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database input for migrate schema Sql Server to Azure SQL Server scenario. */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbDatabaseInput { + /* + * Name of source database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Id of the source database + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of target database + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Database schema migration settings + */ + @JsonProperty(value = "schemaSetting") + private SchemaMigrationSetting schemaSetting; + + /** + * Get the name property: Name of source database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of source database. + * + * @param name the name value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the source database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the source database. + * + * @param id the id value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the schemaSetting property: Database schema migration settings. + * + * @return the schemaSetting value. + */ + public SchemaMigrationSetting schemaSetting() { + return this.schemaSetting; + } + + /** + * Set the schemaSetting property: Database schema migration settings. + * + * @param schemaSetting the schemaSetting value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withSchemaSetting(SchemaMigrationSetting schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schemaSetting() != null) { + schemaSetting().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java new file mode 100644 index 0000000000000..df3ae5244acd1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Input for task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn") + private String startedOn; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Migration start time. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (selectedDatabases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSchemaSqlServerSqlDbTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java new file mode 100644 index 0000000000000..f7586bcfa140a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSchemaSqlServerSqlDbTaskOutput.class) +@JsonTypeName("MigrateSchemaSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "SchemaErrorOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSchemaSqlTaskOutputError.class) +}) +@Immutable +public class MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 0000000000000..900bcf46c3f6f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * The name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * State of the schema migration for this database + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Schema migration stage for this database + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SchemaMigrationStage stage; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Prefix string to use for querying errors for this database + */ + @JsonProperty(value = "databaseErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String databaseErrorResultPrefix; + + /* + * Prefix string to use for querying schema errors for this database + */ + @JsonProperty(value = "schemaErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String schemaErrorResultPrefix; + + /* + * Number of successful operations for this database + */ + @JsonProperty(value = "numberOfSuccessfulOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfSuccessfulOperations; + + /* + * Number of failed operations for this database + */ + @JsonProperty(value = "numberOfFailedOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfFailedOperations; + + /* + * Identifier for the file resource containing the schema of this database + */ + @JsonProperty(value = "fileId", access = JsonProperty.Access.WRITE_ONLY) + private String fileId; + + /** + * Get the databaseName property: The name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the state property: State of the schema migration for this database. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Schema migration stage for this database. + * + * @return the stage value. + */ + public SchemaMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the databaseErrorResultPrefix property: Prefix string to use for querying errors for this database. + * + * @return the databaseErrorResultPrefix value. + */ + public String databaseErrorResultPrefix() { + return this.databaseErrorResultPrefix; + } + + /** + * Get the schemaErrorResultPrefix property: Prefix string to use for querying schema errors for this database. + * + * @return the schemaErrorResultPrefix value. + */ + public String schemaErrorResultPrefix() { + return this.schemaErrorResultPrefix; + } + + /** + * Get the numberOfSuccessfulOperations property: Number of successful operations for this database. + * + * @return the numberOfSuccessfulOperations value. + */ + public Long numberOfSuccessfulOperations() { + return this.numberOfSuccessfulOperations; + } + + /** + * Get the numberOfFailedOperations property: Number of failed operations for this database. + * + * @return the numberOfFailedOperations value. + */ + public Long numberOfFailedOperations() { + return this.numberOfFailedOperations; + } + + /** + * Get the fileId property: Identifier for the file resource containing the schema of this database. + * + * @return the fileId value. + */ + public String fileId() { + return this.fileId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java new file mode 100644 index 0000000000000..894c241a2b847 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("SchemaErrorOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Schema command which failed + */ + @JsonProperty(value = "commandText", access = JsonProperty.Access.WRITE_ONLY) + private String commandText; + + /* + * Reason of failure + */ + @JsonProperty(value = "errorText", access = JsonProperty.Access.WRITE_ONLY) + private String errorText; + + /** + * Get the commandText property: Schema command which failed. + * + * @return the commandText value. + */ + public String commandText() { + return this.commandText; + } + + /** + * Get the errorText property: Reason of failure. + * + * @return the errorText value. + */ + public String errorText() { + return this.errorText; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..72783c71962a3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Overall state of the schema migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get the state property: Overall state of the schema migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java new file mode 100644 index 0000000000000..b432dabeb4343 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("MigrateSchemaSqlServerSqlDb") +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSchemaSqlServerSqlDbTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + + /* + * Task id + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * whether the task can be cloned or not + */ + @JsonProperty(value = "isCloneable") + private Boolean isCloneable; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSchemaSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withInput(MigrateSchemaSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java new file mode 100644 index 0000000000000..a6aa3cd8143bc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSchemaSqlTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java index cee7957f657b3..e4b37a7c6396d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java @@ -5,16 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Database specific information for SQL to Azure SQL DB migration task inputs. */ @Fluent public final class MigrateSqlServerSqlDbDatabaseInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbDatabaseInput.class); - /* * Name of the database */ @@ -38,8 +35,21 @@ public final class MigrateSqlServerSqlDbDatabaseInput { * Mapping of source to target tables */ @JsonProperty(value = "tableMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tableMap; + /* + * Settings selected for DB schema migration. + */ + @JsonProperty(value = "schemaSetting") + private Object schemaSetting; + + /* + * id of the database + */ + @JsonProperty(value = "id") + private String id; + /** * Get the name property: Name of the database. * @@ -122,6 +132,46 @@ public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map table return this; } + /** + * Get the schemaSetting property: Settings selected for DB schema migration. + * + * @return the schemaSetting value. + */ + public Object schemaSetting() { + return this.schemaSetting; + } + + /** + * Set the schemaSetting property: Settings selected for DB schema migration. + * + * @param schemaSetting the schemaSetting value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withSchemaSetting(Object schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + + /** + * Get the id property: id of the database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: id of the database. + * + * @param id the id value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withId(String id) { + this.id = id; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java index f1a6cd7f12f6b..40d9f62fec168 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java @@ -5,16 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Database specific information for SQL to Azure SQL DB sync migration task inputs. */ @Fluent public final class MigrateSqlServerSqlDbSyncDatabaseInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncDatabaseInput.class); - /* * Unique identifier for database */ @@ -43,24 +40,28 @@ public final class MigrateSqlServerSqlDbSyncDatabaseInput { * Mapping of source to target tables */ @JsonProperty(value = "tableMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tableMap; /* * Migration settings which tune the migration behavior */ @JsonProperty(value = "migrationSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map migrationSetting; /* * Source settings to tune source endpoint migration behavior */ @JsonProperty(value = "sourceSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceSetting; /* * Target settings to tune target endpoint migration behavior */ @JsonProperty(value = "targetSetting") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map targetSetting; /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java index 9e336bc475a14..84cc079bc2b61 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. */ @Fluent public final class MigrateSqlServerSqlDbSyncTaskInput extends SqlMigrationTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskInput.class); - /* * Databases to migrate */ @@ -91,7 +88,7 @@ public MigrateSqlServerSqlDbSyncTaskInput withTargetConnectionInfo(SqlConnection public void validate() { super.validate(); if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model MigrateSqlServerSqlDbSyncTaskInput")); @@ -102,4 +99,6 @@ public void validate() { validationOptions().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSqlServerSqlDbSyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java index ebbcf594d3549..e51d067b115be 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -30,8 +28,6 @@ }) @Immutable public class MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java index cdd5adb684c87..1972b8797b98d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @JsonTypeName("DatabaseLevelErrorOutput") @Fluent public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError extends MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class); - /* * Error message */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java index f04fdec7e341d..00a1137d70275 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @JsonTypeName("DatabaseLevelOutput") @Immutable public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java index 6ccaf69fc2561..e9765d00e5c02 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("ErrorOutput") @Immutable public final class MigrateSqlServerSqlDbSyncTaskOutputError extends MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputError.class); - /* * Migration error */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java index dfebad2dd0963..671ac6802feed 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @JsonTypeName("MigrationLevelOutput") @Immutable public final class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel extends MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class); - /* * Migration start time */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java index ee0b43c563fd0..bccc206209cd3 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @JsonTypeName("TableLevelOutput") @Immutable public final class MigrateSqlServerSqlDbSyncTaskOutputTableLevel extends MigrateSqlServerSqlDbSyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class); - /* * Name of the table */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java index 13f16a3264acf..61d578ac8982c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("Migrate.SqlServer.AzureSqlDb.Sync") @Fluent public final class MigrateSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskProperties.class); - /* * Task input */ @@ -60,6 +57,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java index 39ae8e48b5178..3825123975e63 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for the task that migrates on-prem SQL Server databases to Azure SQL Database. */ @Fluent public final class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskInput.class); - /* * Databases to migrate */ @@ -37,6 +34,18 @@ public final class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput @JsonProperty(value = "validationOptions") private MigrationValidationOptions validationOptions; + /* + * Date and time relative to UTC when the migration was started on + */ + @JsonProperty(value = "startedOn") + private String startedOn; + + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + /** * Get the selectedDatabases property: Databases to migrate. * @@ -88,6 +97,46 @@ public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationO return this; } + /** + * Get the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** {@inheritDoc} */ @Override public MigrateSqlServerSqlDbTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { @@ -111,7 +160,7 @@ public MigrateSqlServerSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo public void validate() { super.validate(); if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model MigrateSqlServerSqlDbTaskInput")); @@ -122,4 +171,6 @@ public void validate() { validationOptions().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSqlServerSqlDbTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java index 3f66df0779b1b..dcd4cbd06d187 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -33,8 +31,6 @@ }) @Immutable public class MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java index 1c703912e8720..f1fe6d9019219 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -5,22 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Database level result for Sql Server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputDatabaseLevel model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("DatabaseLevelOutput") @Immutable public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class); - /* * Name of the item */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java index e07d45443b0c0..8bbd785700360 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java @@ -5,22 +5,22 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; -/** Database validation result for Sql Server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("MigrationDatabaseLevelValidationOutput") @Immutable public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.class); + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; /* * Migration Identifier @@ -78,6 +78,15 @@ public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + /** * Get the migrationId property: Migration Identifier. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java index b2bac53fd16c4..d179c13482004 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java @@ -5,19 +5,15 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Task errors for Sql Server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputError model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("ErrorOutput") @Immutable public final class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputError.class); - /* * Migration error */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java index 0b56679694dd2..b7b2be526567c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java @@ -4,23 +4,18 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; import java.util.List; -/** Migration level result for Sql server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputMigrationLevel model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("MigrationLevelOutput") -@Immutable +@Fluent public final class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputMigrationLevel.class); - /* * Migration start time */ @@ -69,12 +64,18 @@ public final class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends Migrate @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) private String databaseSummary; + /* + * Migration Validation Results + */ + @JsonProperty(value = "migrationValidationResult") + private MigrationValidationResult migrationValidationResult; + /* * Migration Report Result, provides unique url for downloading your * migration report. */ - @JsonProperty(value = "migrationReport", access = JsonProperty.Access.WRITE_ONLY) - private MigrationReportResult migrationReport; + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; /* * Source server version @@ -179,13 +180,47 @@ public String databaseSummary() { } /** - * Get the migrationReport property: Migration Report Result, provides unique url for downloading your migration - * report. + * Get the migrationValidationResult property: Migration Validation Results. + * + * @return the migrationValidationResult value. + */ + public MigrationValidationResult migrationValidationResult() { + return this.migrationValidationResult; + } + + /** + * Set the migrationValidationResult property: Migration Validation Results. + * + * @param migrationValidationResult the migrationValidationResult value to set. + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationValidationResult( + MigrationValidationResult migrationValidationResult) { + this.migrationValidationResult = migrationValidationResult; + return this; + } + + /** + * Get the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. * - * @return the migrationReport value. + * @return the migrationReportResult value. */ - public MigrationReportResult migrationReport() { - return this.migrationReport; + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @param migrationReportResult the migrationReportResult value to set. + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult( + MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; } /** @@ -241,8 +276,11 @@ public List exceptionsAndWarnings() { @Override public void validate() { super.validate(); - if (migrationReport() != null) { - migrationReport().validate(); + if (migrationValidationResult() != null) { + migrationValidationResult().validate(); + } + if (migrationReportResult() != null) { + migrationReportResult().validate(); } if (exceptionsAndWarnings() != null) { exceptionsAndWarnings().forEach(e -> e.validate()); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java index 94444ea7231bc..68d41087ade19 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.OffsetDateTime; -/** Table level result for Sql Server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputTableLevel model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("TableLevelOutput") @Immutable public final class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputTableLevel.class); - /* * Name of the item */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java index 8715b6c44e8b0..b49f747ca868b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java @@ -5,20 +5,22 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** Validation result for Sql Server to Azure Sql DB migration. */ +/** The MigrateSqlServerSqlDbTaskOutputValidationResult model. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") @JsonTypeName("MigrationValidationOutput") @Fluent public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputValidationResult.class); + /* + * Migration validation result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; /* * Migration Identifier @@ -30,6 +32,7 @@ public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends Migra * Validation summary results for each database */ @JsonProperty(value = "summaryResults") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map summaryResults; /* @@ -39,6 +42,15 @@ public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends Migra @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private ValidationStatus status; + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + /** * Get the migrationId property: Migration Identifier. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java index 02739b1bac63e..f77f2ffd3f440 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("Migrate.SqlServer.SqlDb") @Fluent public final class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskProperties.class); - /* * Task input */ @@ -31,6 +28,24 @@ public final class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProper @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * task id + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * whether the task can be cloned or not + */ + @JsonProperty(value = "isCloneable") + private Boolean isCloneable; + + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + /** * Get the input property: Task input. * @@ -60,6 +75,73 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java index f4e3bfb02f0c8..f8aefd07b09c0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs. */ @Fluent public final class MigrateSqlServerSqlMIDatabaseInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMIDatabaseInput.class); - /* * Name of the database */ @@ -39,6 +36,12 @@ public final class MigrateSqlServerSqlMIDatabaseInput { @JsonProperty(value = "backupFilePaths") private List backupFilePaths; + /* + * id of the database + */ + @JsonProperty(value = "id") + private String id; + /** * Get the name property: Name of the database. * @@ -119,6 +122,26 @@ public MigrateSqlServerSqlMIDatabaseInput withBackupFilePaths(List backu return this; } + /** + * Get the id property: id of the database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: id of the database. + * + * @param id the id value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withId(String id) { + this.id = id; + return this; + } + /** * Validates the instance. * @@ -126,13 +149,13 @@ public MigrateSqlServerSqlMIDatabaseInput withBackupFilePaths(List backu */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property name in model MigrateSqlServerSqlMIDatabaseInput")); } if (restoreDatabaseName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property restoreDatabaseName in model MigrateSqlServerSqlMIDatabaseInput")); @@ -141,4 +164,6 @@ public void validate() { backupFileShare().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSqlServerSqlMIDatabaseInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java index 1dc136339c640..711cac153d5d9 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java @@ -4,15 +4,39 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ -@Immutable +@Fluent public final class MigrateSqlServerSqlMISyncTaskInput extends SqlServerSqlMISyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskInput.class); + /* + * Number of database migrations to start in parallel + */ + @JsonProperty(value = "numberOfParallelDatabaseMigrations") + private Float numberOfParallelDatabaseMigrations; + + /** + * Get the numberOfParallelDatabaseMigrations property: Number of database migrations to start in parallel. + * + * @return the numberOfParallelDatabaseMigrations value. + */ + public Float numberOfParallelDatabaseMigrations() { + return this.numberOfParallelDatabaseMigrations; + } + + /** + * Set the numberOfParallelDatabaseMigrations property: Number of database migrations to start in parallel. + * + * @param numberOfParallelDatabaseMigrations the numberOfParallelDatabaseMigrations value to set. + * @return the MigrateSqlServerSqlMISyncTaskInput object itself. + */ + public MigrateSqlServerSqlMISyncTaskInput withNumberOfParallelDatabaseMigrations( + Float numberOfParallelDatabaseMigrations) { + this.numberOfParallelDatabaseMigrations = numberOfParallelDatabaseMigrations; + return this; + } /** {@inheritDoc} */ @Override diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java index 137cbc8c1c9b4..e4f6816feeea2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -28,8 +26,6 @@ }) @Immutable public class MigrateSqlServerSqlMISyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java index 76aff2adacc64..9c477ee48dc06 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @JsonTypeName("DatabaseLevelOutput") @Immutable public final class MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlMISyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java index a239e5eaaba17..c3248f671741a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("ErrorOutput") @Immutable public final class MigrateSqlServerSqlMISyncTaskOutputError extends MigrateSqlServerSqlMISyncTaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputError.class); - /* * Migration error */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java index 282c621db73c8..d4dddd82d7f06 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @JsonTypeName("MigrationLevelOutput") @Immutable public final class MigrateSqlServerSqlMISyncTaskOutputMigrationLevel extends MigrateSqlServerSqlMISyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.class); - /* * Count of databases */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java index 701a543f25c67..05b7ebef9db44 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") @Fluent public final class MigrateSqlServerSqlMISyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskProperties.class); - /* * Task input */ @@ -31,6 +28,12 @@ public final class MigrateSqlServerSqlMISyncTaskProperties extends ProjectTaskPr @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + /** * Get the input property: Task input. * @@ -60,6 +63,33 @@ public List output() { return this.output; } + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlMISyncTaskProperties object itself. + */ + public MigrateSqlServerSqlMISyncTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java index 5a876c15923f8..e2eaa094b7c03 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java @@ -6,21 +6,24 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. */ @Fluent public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskInput.class); - /* * Databases to migrate */ @JsonProperty(value = "selectedDatabases", required = true) private List selectedDatabases; + /* + * Date and time relative to UTC when the migration was started on + */ + @JsonProperty(value = "startedOn") + private String startedOn; + /* * Logins to migrate. */ @@ -54,6 +57,20 @@ public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput @JsonProperty(value = "backupMode") private BackupMode backupMode; + /* + * 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 + */ + @JsonProperty(value = "aadDomainName") + private String aadDomainName; + + /* + * encrypted key for secure fields + */ + @JsonProperty(value = "encryptedKeyForSecureFields") + private String encryptedKeyForSecureFields; + /** * Get the selectedDatabases property: Databases to migrate. * @@ -75,6 +92,26 @@ public MigrateSqlServerSqlMITaskInput withSelectedDatabases( return this; } + /** + * Get the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + /** * Get the selectedLogins property: Logins to migrate. * @@ -177,6 +214,48 @@ public MigrateSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { return this; } + /** + * Get the aadDomainName property: 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. + * + * @return the aadDomainName value. + */ + public String aadDomainName() { + return this.aadDomainName; + } + + /** + * Set the aadDomainName property: 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. + * + * @param aadDomainName the aadDomainName value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withAadDomainName(String aadDomainName) { + this.aadDomainName = aadDomainName; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** {@inheritDoc} */ @Override public MigrateSqlServerSqlMITaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { @@ -200,7 +279,7 @@ public MigrateSqlServerSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo public void validate() { super.validate(); if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model MigrateSqlServerSqlMITaskInput")); @@ -211,7 +290,7 @@ public void validate() { backupFileShare().validate(); } if (backupBlobShare() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupBlobShare in model MigrateSqlServerSqlMITaskInput")); @@ -219,4 +298,6 @@ public void validate() { backupBlobShare().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSqlServerSqlMITaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java index c5197a96833cd..6c4ddbfb0bf75 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -28,8 +26,6 @@ }) @Immutable public class MigrateSqlServerSqlMITaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java index e2a4edb1053aa..88f6df6d17e72 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @JsonTypeName("AgentJobLevelOutput") @Immutable public final class MigrateSqlServerSqlMITaskOutputAgentJobLevel extends MigrateSqlServerSqlMITaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputAgentJobLevel.class); - /* * Agent Job name. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java index bfd652a8df965..b0e25d49d413f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @JsonTypeName("DatabaseLevelOutput") @Immutable public final class MigrateSqlServerSqlMITaskOutputDatabaseLevel extends MigrateSqlServerSqlMITaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputDatabaseLevel.class); - /* * Name of the database */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java index eab59bdb35a42..f5222180e0627 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("ErrorOutput") @Immutable public final class MigrateSqlServerSqlMITaskOutputError extends MigrateSqlServerSqlMITaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputError.class); - /* * Migration error */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java index ef4f55405c3b6..5159928094432 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +16,6 @@ @JsonTypeName("LoginLevelOutput") @Immutable public final class MigrateSqlServerSqlMITaskOutputLoginLevel extends MigrateSqlServerSqlMITaskOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputLoginLevel.class); - /* * Login name. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java index 34b77e48316cb..9ac405271b806 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,9 +16,6 @@ @JsonTypeName("MigrationLevelOutput") @Immutable public final class MigrateSqlServerSqlMITaskOutputMigrationLevel extends MigrateSqlServerSqlMITaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputMigrationLevel.class); - /* * Migration start time */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java index 139586f0bd3c1..a1babdca3c349 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java @@ -5,20 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("Migrate.SqlServer.AzureSqlDbMI") @Fluent public final class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskProperties.class); - /* * Task input */ @@ -31,6 +28,30 @@ public final class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProper @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private List output; + /* + * task id + */ + @JsonProperty(value = "taskId") + private String taskId; + + /* + * DateTime in UTC when the task was created + */ + @JsonProperty(value = "createdOn") + private String createdOn; + + /* + * parent task id + */ + @JsonProperty(value = "parentTaskId") + private String parentTaskId; + + /* + * whether the task can be cloned or not + */ + @JsonProperty(value = "isCloneable") + private Boolean isCloneable; + /** * Get the input property: Task input. * @@ -60,6 +81,93 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the parentTaskId property: parent task id. + * + * @return the parentTaskId value. + */ + public String parentTaskId() { + return this.parentTaskId; + } + + /** + * Set the parentTaskId property: parent task id. + * + * @param parentTaskId the parentTaskId value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withParentTaskId(String parentTaskId) { + this.parentTaskId = parentTaskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java new file mode 100644 index 0000000000000..3ffb0b01d6733 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. */ +@Fluent +public final class MigrateSsisTaskInput extends SqlMigrationTaskInput { + /* + * SSIS package migration information. + */ + @JsonProperty(value = "ssisMigrationInfo", required = true) + private SsisMigrationInfo ssisMigrationInfo; + + /** + * Get the ssisMigrationInfo property: SSIS package migration information. + * + * @return the ssisMigrationInfo value. + */ + public SsisMigrationInfo ssisMigrationInfo() { + return this.ssisMigrationInfo; + } + + /** + * Set the ssisMigrationInfo property: SSIS package migration information. + * + * @param ssisMigrationInfo the ssisMigrationInfo value to set. + * @return the MigrateSsisTaskInput object itself. + */ + public MigrateSsisTaskInput withSsisMigrationInfo(SsisMigrationInfo ssisMigrationInfo) { + this.ssisMigrationInfo = ssisMigrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ssisMigrationInfo() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ssisMigrationInfo in model MigrateSsisTaskInput")); + } else { + ssisMigrationInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSsisTaskInput.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java new file mode 100644 index 0000000000000..1ac575f54bd5e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSsisTaskOutput.class) +@JsonTypeName("MigrateSsisTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSsisTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "SsisProjectLevelOutput", value = MigrateSsisTaskOutputProjectLevel.class) +}) +@Immutable +public class MigrateSsisTaskOutput { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java new file mode 100644 index 0000000000000..0800bc6047c84 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSsisTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSsisTaskOutputMigrationLevel extends MigrateSsisTaskOutput { + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current status of migration + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /* + * Stage of SSIS migration. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SsisMigrationStage stage; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the stage property: Stage of SSIS migration. + * + * @return the stage value. + */ + public SsisMigrationStage stage() { + return this.stage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java new file mode 100644 index 0000000000000..5833862693b44 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSsisTaskOutputProjectLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("SsisProjectLevelOutput") +@Immutable +public final class MigrateSsisTaskOutputProjectLevel extends MigrateSsisTaskOutput { + /* + * Name of the folder + */ + @JsonProperty(value = "folderName", access = JsonProperty.Access.WRITE_ONLY) + private String folderName; + + /* + * Name of the project + */ + @JsonProperty(value = "projectName", access = JsonProperty.Access.WRITE_ONLY) + private String projectName; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Stage of SSIS migration. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SsisMigrationStage stage; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Migration exceptions and warnings + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the folderName property: Name of the folder. + * + * @return the folderName value. + */ + public String folderName() { + return this.folderName; + } + + /** + * Get the projectName property: Name of the project. + * + * @return the projectName value. + */ + public String projectName() { + return this.projectName; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Stage of SSIS migration. + * + * @return the stage value. + */ + public SsisMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java new file mode 100644 index 0000000000000..f32125312574c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.Ssis") +@Fluent +public final class MigrateSsisTaskProperties extends ProjectTaskProperties { + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSsisTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSsisTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSsisTaskProperties object itself. + */ + public MigrateSsisTaskProperties withInput(MigrateSsisTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java index 8afe850739aeb..5a72c3b1bb4f7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Input for command that completes sync migration for a database. */ @Fluent public final class MigrateSyncCompleteCommandInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandInput.class); - /* * Name of database */ @@ -74,10 +71,12 @@ public MigrateSyncCompleteCommandInput withCommitTimestamp(OffsetDateTime commit */ public void validate() { if (databaseName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property databaseName in model MigrateSyncCompleteCommandInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSyncCompleteCommandInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java index 8a1a1fb5b7670..25a4b854e2c45 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for command that completes sync migration for a database. */ @Immutable public final class MigrateSyncCompleteCommandOutput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java index 164677855ca81..d67eb66bdce45 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java @@ -5,8 +5,7 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -15,9 +14,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") @JsonTypeName("Migrate.Sync.Complete.Database") @Fluent -public final class MigrateSyncCompleteCommandProperties extends CommandProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandProperties.class); - +public final class MigrateSyncCompleteCommandProperties extends CommandPropertiesInner { /* * Command input */ @@ -30,6 +27,12 @@ public final class MigrateSyncCompleteCommandProperties extends CommandPropertie @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) private MigrateSyncCompleteCommandOutput output; + /* + * Command id + */ + @JsonProperty(value = "commandId") + private String commandId; + /** * Get the input property: Command input. * @@ -59,6 +62,26 @@ public MigrateSyncCompleteCommandOutput output() { return this.output; } + /** + * Get the commandId property: Command id. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Set the commandId property: Command id. + * + * @param commandId the commandId value to set. + * @return the MigrateSyncCompleteCommandProperties object itself. + */ + public MigrateSyncCompleteCommandProperties withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java index d9b8d4bf2f7c7..59ec33eb535e5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Information about migration eligibility of a server object. */ @Immutable public final class MigrationEligibilityInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationEligibilityInfo.class); - /* * Whether object is eligible for migration or not. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java new file mode 100644 index 0000000000000..b9f6b74cd590c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Migration Operation Input. */ +@Fluent +public final class MigrationOperationInput { + /* + * ID tracking migration operation. + */ + @JsonProperty(value = "migrationOperationId") + private UUID migrationOperationId; + + /** + * Get the migrationOperationId property: ID tracking migration operation. + * + * @return the migrationOperationId value. + */ + public UUID migrationOperationId() { + return this.migrationOperationId; + } + + /** + * Set the migrationOperationId property: ID tracking migration operation. + * + * @param migrationOperationId the migrationOperationId value to set. + * @return the MigrationOperationInput object itself. + */ + public MigrationOperationInput withMigrationOperationId(UUID migrationOperationId) { + this.migrationOperationId = migrationOperationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java index 8f09dfd97386a..2e4c0f974c685 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java @@ -4,26 +4,22 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Migration validation report result, contains the url for downloading the generated report. */ -@Immutable +@Fluent public final class MigrationReportResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationReportResult.class); - /* * Migration validation result identifier */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "id") private String id; /* * The url of the report. */ - @JsonProperty(value = "reportUrl", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "reportUrl") private String reportUrl; /** @@ -35,6 +31,17 @@ public String id() { return this.id; } + /** + * Set the id property: Migration validation result identifier. + * + * @param id the id value to set. + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withId(String id) { + this.id = id; + return this; + } + /** * Get the reportUrl property: The url of the report. * @@ -44,6 +51,17 @@ public String reportUrl() { return this.reportUrl; } + /** + * Set the reportUrl property: The url of the report. + * + * @param reportUrl the reportUrl value to set. + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withReportUrl(String reportUrl) { + this.reportUrl = reportUrl; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java new file mode 100644 index 0000000000000..bfcb80378efe3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Detailed status of current migration. */ +@Immutable +public final class MigrationStatusDetails { + /* + * Current State of Migration. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private String migrationState; + + /* + * Details of full backup set. + */ + @JsonProperty(value = "fullBackupSetInfo", access = JsonProperty.Access.WRITE_ONLY) + private SqlBackupSetInfo fullBackupSetInfo; + + /* + * Last applied backup set information. + */ + @JsonProperty(value = "lastRestoredBackupSetInfo", access = JsonProperty.Access.WRITE_ONLY) + private SqlBackupSetInfo lastRestoredBackupSetInfo; + + /* + * Backup sets that are currently active. + */ + @JsonProperty(value = "activeBackupSets", access = JsonProperty.Access.WRITE_ONLY) + private List activeBackupSets; + + /* + * Files that are not valid backup files. + */ + @JsonProperty(value = "invalidFiles", access = JsonProperty.Access.WRITE_ONLY) + private List invalidFiles; + + /* + * Name of blob container. + */ + @JsonProperty(value = "blobContainerName", access = JsonProperty.Access.WRITE_ONLY) + private String blobContainerName; + + /* + * Whether full backup has been applied to the target database or not. + */ + @JsonProperty(value = "isFullBackupRestored", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFullBackupRestored; + + /* + * Restore blocking reason, if any + */ + @JsonProperty(value = "restoreBlockingReason", access = JsonProperty.Access.WRITE_ONLY) + private String restoreBlockingReason; + + /* + * Complete restore error message, if any + */ + @JsonProperty(value = "completeRestoreErrorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String completeRestoreErrorMessage; + + /* + * File upload blocking errors, if any. + */ + @JsonProperty(value = "fileUploadBlockingErrors", access = JsonProperty.Access.WRITE_ONLY) + private List fileUploadBlockingErrors; + + /* + * File name that is currently being restored. + */ + @JsonProperty(value = "currentRestoringFilename", access = JsonProperty.Access.WRITE_ONLY) + private String currentRestoringFilename; + + /* + * Last restored file name. + */ + @JsonProperty(value = "lastRestoredFilename", access = JsonProperty.Access.WRITE_ONLY) + private String lastRestoredFilename; + + /* + * Total pending log backups. + */ + @JsonProperty(value = "pendingLogBackupsCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer pendingLogBackupsCount; + + /** + * Get the migrationState property: Current State of Migration. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.migrationState; + } + + /** + * Get the fullBackupSetInfo property: Details of full backup set. + * + * @return the fullBackupSetInfo value. + */ + public SqlBackupSetInfo fullBackupSetInfo() { + return this.fullBackupSetInfo; + } + + /** + * Get the lastRestoredBackupSetInfo property: Last applied backup set information. + * + * @return the lastRestoredBackupSetInfo value. + */ + public SqlBackupSetInfo lastRestoredBackupSetInfo() { + return this.lastRestoredBackupSetInfo; + } + + /** + * Get the activeBackupSets property: Backup sets that are currently active. + * + * @return the activeBackupSets value. + */ + public List activeBackupSets() { + return this.activeBackupSets; + } + + /** + * Get the invalidFiles property: Files that are not valid backup files. + * + * @return the invalidFiles value. + */ + public List invalidFiles() { + return this.invalidFiles; + } + + /** + * Get the blobContainerName property: Name of blob container. + * + * @return the blobContainerName value. + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Get the isFullBackupRestored property: Whether full backup has been applied to the target database or not. + * + * @return the isFullBackupRestored value. + */ + public Boolean isFullBackupRestored() { + return this.isFullBackupRestored; + } + + /** + * Get the restoreBlockingReason property: Restore blocking reason, if any. + * + * @return the restoreBlockingReason value. + */ + public String restoreBlockingReason() { + return this.restoreBlockingReason; + } + + /** + * Get the completeRestoreErrorMessage property: Complete restore error message, if any. + * + * @return the completeRestoreErrorMessage value. + */ + public String completeRestoreErrorMessage() { + return this.completeRestoreErrorMessage; + } + + /** + * Get the fileUploadBlockingErrors property: File upload blocking errors, if any. + * + * @return the fileUploadBlockingErrors value. + */ + public List fileUploadBlockingErrors() { + return this.fileUploadBlockingErrors; + } + + /** + * Get the currentRestoringFilename property: File name that is currently being restored. + * + * @return the currentRestoringFilename value. + */ + public String currentRestoringFilename() { + return this.currentRestoringFilename; + } + + /** + * Get the lastRestoredFilename property: Last restored file name. + * + * @return the lastRestoredFilename value. + */ + public String lastRestoredFilename() { + return this.lastRestoredFilename; + } + + /** + * Get the pendingLogBackupsCount property: Total pending log backups. + * + * @return the pendingLogBackupsCount value. + */ + public Integer pendingLogBackupsCount() { + return this.pendingLogBackupsCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fullBackupSetInfo() != null) { + fullBackupSetInfo().validate(); + } + if (lastRestoredBackupSetInfo() != null) { + lastRestoredBackupSetInfo().validate(); + } + if (activeBackupSets() != null) { + activeBackupSets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java deleted file mode 100644 index a3741dd90bf5e..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metadata for tables selected in migration project. */ -@Immutable -public final class MigrationTableMetadata { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationTableMetadata.class); - - /* - * Source table name - */ - @JsonProperty(value = "sourceTableName", access = JsonProperty.Access.WRITE_ONLY) - private String sourceTableName; - - /* - * Target table name - */ - @JsonProperty(value = "targetTableName", access = JsonProperty.Access.WRITE_ONLY) - private String targetTableName; - - /** - * Get the sourceTableName property: Source table name. - * - * @return the sourceTableName value. - */ - public String sourceTableName() { - return this.sourceTableName; - } - - /** - * Get the targetTableName property: Target table name. - * - * @return the targetTableName value. - */ - public String targetTableName() { - return this.targetTableName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java new file mode 100644 index 0000000000000..62e678546f6c9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Database level validation results. */ +@Immutable +public class MigrationValidationDatabaseLevelResult { + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Migration Identifier + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /* + * Name of the source database + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /* + * Name of the target database + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /* + * Validation start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Validation end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Provides data integrity validation result between the source and target + * tables that are migrated. + */ + @JsonProperty(value = "dataIntegrityValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private DataIntegrityValidationResult dataIntegrityValidationResult; + + /* + * Provides schema comparison result between source and target database + */ + @JsonProperty(value = "schemaValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private SchemaComparisonValidationResult schemaValidationResult; + + /* + * Results of some of the query execution result between source and target + * database + */ + @JsonProperty(value = "queryAnalysisValidationResult", access = JsonProperty.Access.WRITE_ONLY) + private QueryAnalysisValidationResult queryAnalysisValidationResult; + + /* + * Current status of validation at the database level + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get the sourceDatabaseName property: Name of the source database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get the targetDatabaseName property: Name of the target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get the startedOn property: Validation start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Validation end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the dataIntegrityValidationResult property: Provides data integrity validation result between the source and + * target tables that are migrated. + * + * @return the dataIntegrityValidationResult value. + */ + public DataIntegrityValidationResult dataIntegrityValidationResult() { + return this.dataIntegrityValidationResult; + } + + /** + * Get the schemaValidationResult property: Provides schema comparison result between source and target database. + * + * @return the schemaValidationResult value. + */ + public SchemaComparisonValidationResult schemaValidationResult() { + return this.schemaValidationResult; + } + + /** + * Get the queryAnalysisValidationResult property: Results of some of the query execution result between source and + * target database. + * + * @return the queryAnalysisValidationResult value. + */ + public QueryAnalysisValidationResult queryAnalysisValidationResult() { + return this.queryAnalysisValidationResult; + } + + /** + * Get the status property: Current status of validation at the database level. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataIntegrityValidationResult() != null) { + dataIntegrityValidationResult().validate(); + } + if (schemaValidationResult() != null) { + schemaValidationResult().validate(); + } + if (queryAnalysisValidationResult() != null) { + queryAnalysisValidationResult().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java index 403d75ac6609b..29c63f8fdca7a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Migration Validation Database level summary result. */ @Immutable public final class MigrationValidationDatabaseSummaryResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationDatabaseSummaryResult.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java index 17577d342cf23..3cd8173eef843 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Types of validations to run after the migration. */ @Fluent public final class MigrationValidationOptions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationOptions.class); - /* * Allows to compare the schema information between source and target. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java new file mode 100644 index 0000000000000..f1bd414163e73 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Migration Validation Result. */ +@Fluent +public class MigrationValidationResult { + /* + * Migration validation result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Migration Identifier + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /* + * Validation summary results for each database + */ + @JsonProperty(value = "summaryResults") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map summaryResults; + + /* + * Current status of validation at the migration level. Status from the + * database validation result status will be aggregated here. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get the summaryResults property: Validation summary results for each database. + * + * @return the summaryResults value. + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set the summaryResults property: Validation summary results for each database. + * + * @param summaryResults the summaryResults value to set. + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult withSummaryResults( + Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get the status property: Current status of validation at the migration level. Status from the database validation + * result status will be aggregated here. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summaryResults() != null) { + summaryResults() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java new file mode 100644 index 0000000000000..d201811b66903 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that cancels a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("cancel") +@Fluent +public final class MongoDbCancelCommand extends CommandPropertiesInner { + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbCancelCommand object itself. + */ + public MongoDbCancelCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java new file mode 100644 index 0000000000000..c83e19433c627 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a MongoDB data source. */ +@Fluent +public final class MongoDbClusterInfo { + /* + * A list of non-system databases in the cluster + */ + @JsonProperty(value = "databases", required = true) + private List databases; + + /* + * Whether the cluster supports sharded collections + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /* + * The type of data source + */ + @JsonProperty(value = "type", required = true) + private MongoDbClusterType type; + + /* + * The version of the data source in the form x.y.z (e.g. 3.6.7). Not used + * if Type is BlobContainer. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /** + * Get the databases property: A list of non-system databases in the cluster. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Set the databases property: A list of non-system databases in the cluster. + * + * @param databases the databases value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withDatabases(List databases) { + this.databases = databases; + return this; + } + + /** + * Get the supportsSharding property: Whether the cluster supports sharded collections. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the cluster supports sharded collections. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the type property: The type of data source. + * + * @return the type value. + */ + public MongoDbClusterType type() { + return this.type; + } + + /** + * Set the type property: The type of data source. + * + * @param type the type value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withType(MongoDbClusterType type) { + this.type = type; + return this; + } + + /** + * Get the version property: The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is + * BlobContainer. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is + * BlobContainer. + * + * @param version the version value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property databases in model MongoDbClusterInfo")); + } else { + databases().forEach(e -> e.validate()); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model MongoDbClusterInfo")); + } + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property version in model MongoDbClusterInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbClusterInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java new file mode 100644 index 0000000000000..70347d9a2a673 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbClusterType. */ +public final class MongoDbClusterType extends ExpandableStringEnum { + /** Static value BlobContainer for MongoDbClusterType. */ + public static final MongoDbClusterType BLOB_CONTAINER = fromString("BlobContainer"); + + /** Static value CosmosDb for MongoDbClusterType. */ + public static final MongoDbClusterType COSMOS_DB = fromString("CosmosDb"); + + /** Static value MongoDb for MongoDbClusterType. */ + public static final MongoDbClusterType MONGO_DB = fromString("MongoDb"); + + /** + * Creates or finds a MongoDbClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbClusterType. + */ + @JsonCreator + public static MongoDbClusterType fromString(String name) { + return fromString(name, MongoDbClusterType.class); + } + + /** @return known MongoDbClusterType values. */ + public static Collection values() { + return values(MongoDbClusterType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java new file mode 100644 index 0000000000000..1998f37c21d8c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a supported collection within a MongoDB database. */ +@Fluent +public final class MongoDbCollectionInfo extends MongoDbObjectInfo { + /* + * The name of the database containing the collection + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /* + * Whether the collection is a capped collection (i.e. whether it has a + * fixed size and acts like a circular buffer) + */ + @JsonProperty(value = "isCapped", required = true) + private boolean isCapped; + + /* + * Whether the collection is system collection + */ + @JsonProperty(value = "isSystemCollection", required = true) + private boolean isSystemCollection; + + /* + * Whether the collection is a view of another collection + */ + @JsonProperty(value = "isView", required = true) + private boolean isView; + + /* + * The shard key on the collection, or null if the collection is not + * sharded + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeyInfo shardKey; + + /* + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /* + * The name of the collection that this is a view of, if IsView is true + */ + @JsonProperty(value = "viewOf") + private String viewOf; + + /** + * Get the databaseName property: The name of the database containing the collection. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database containing the collection. + * + * @param databaseName the databaseName value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the isCapped property: Whether the collection is a capped collection (i.e. whether it has a fixed size and + * acts like a circular buffer). + * + * @return the isCapped value. + */ + public boolean isCapped() { + return this.isCapped; + } + + /** + * Set the isCapped property: Whether the collection is a capped collection (i.e. whether it has a fixed size and + * acts like a circular buffer). + * + * @param isCapped the isCapped value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsCapped(boolean isCapped) { + this.isCapped = isCapped; + return this; + } + + /** + * Get the isSystemCollection property: Whether the collection is system collection. + * + * @return the isSystemCollection value. + */ + public boolean isSystemCollection() { + return this.isSystemCollection; + } + + /** + * Set the isSystemCollection property: Whether the collection is system collection. + * + * @param isSystemCollection the isSystemCollection value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsSystemCollection(boolean isSystemCollection) { + this.isSystemCollection = isSystemCollection; + return this; + } + + /** + * Get the isView property: Whether the collection is a view of another collection. + * + * @return the isView value. + */ + public boolean isView() { + return this.isView; + } + + /** + * Set the isView property: Whether the collection is a view of another collection. + * + * @param isView the isView value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsView(boolean isView) { + this.isView = isView; + return this; + } + + /** + * Get the shardKey property: The shard key on the collection, or null if the collection is not sharded. + * + * @return the shardKey value. + */ + public MongoDbShardKeyInfo shardKey() { + return this.shardKey; + } + + /** + * Set the shardKey property: The shard key on the collection, or null if the collection is not sharded. + * + * @param shardKey the shardKey value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withShardKey(MongoDbShardKeyInfo shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the viewOf property: The name of the collection that this is a view of, if IsView is true. + * + * @return the viewOf value. + */ + public String viewOf() { + return this.viewOf; + } + + /** + * Set the viewOf property: The name of the collection that this is a view of, if IsView is true. + * + * @param viewOf the viewOf value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withViewOf(String viewOf) { + this.viewOf = viewOf; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withAverageDocumentSize(long averageDocumentSize) { + super.withAverageDocumentSize(averageDocumentSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withDataSize(long dataSize) { + super.withDataSize(dataSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withDocumentCount(long documentCount) { + super.withDocumentCount(documentCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (databaseName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseName in model MongoDbCollectionInfo")); + } + if (shardKey() != null) { + shardKey().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbCollectionInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java new file mode 100644 index 0000000000000..648a11e8d29ee --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of a collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Collection") +@Fluent +public final class MongoDbCollectionProgress extends MongoDbProgress { + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java new file mode 100644 index 0000000000000..c765c23f1b9d9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes how an individual MongoDB collection should be migrated. */ +@Fluent +public final class MongoDbCollectionSettings { + /* + * Whether the migrator is allowed to drop the target collection in the + * course of performing a migration. The default is true. + */ + @JsonProperty(value = "canDelete") + private Boolean canDelete; + + /* + * Describes a MongoDB shard key + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeySetting shardKey; + + /* + * The RUs that should be configured on a CosmosDB target, or null to use + * the default. This has no effect on non-CosmosDB targets. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get the canDelete property: Whether the migrator is allowed to drop the target collection in the course of + * performing a migration. The default is true. + * + * @return the canDelete value. + */ + public Boolean canDelete() { + return this.canDelete; + } + + /** + * Set the canDelete property: Whether the migrator is allowed to drop the target collection in the course of + * performing a migration. The default is true. + * + * @param canDelete the canDelete value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withCanDelete(Boolean canDelete) { + this.canDelete = canDelete; + return this; + } + + /** + * Get the shardKey property: Describes a MongoDB shard key. + * + * @return the shardKey value. + */ + public MongoDbShardKeySetting shardKey() { + return this.shardKey; + } + + /** + * Set the shardKey property: Describes a MongoDB shard key. + * + * @param shardKey the shardKey value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withShardKey(MongoDbShardKeySetting shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default. + * This has no effect on non-CosmosDB targets. + * + * @return the targetRUs value. + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default. + * This has no effect on non-CosmosDB targets. + * + * @param targetRUs the targetRUs value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shardKey() != null) { + shardKey().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java new file mode 100644 index 0000000000000..41b65d3cf6988 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the input to the 'cancel' and 'restart' MongoDB migration commands. */ +@Fluent +public class MongoDbCommandInput { + /* + * The qualified name of a database or collection to act upon, or null to + * act upon the entire migration + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Get the objectName property: The qualified name of a database or collection to act upon, or null to act upon the + * entire migration. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Set the objectName property: The qualified name of a database or collection to act upon, or null to act upon the + * entire migration. + * + * @param objectName the objectName value to set. + * @return the MongoDbCommandInput object itself. + */ + public MongoDbCommandInput withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java new file mode 100644 index 0000000000000..a6c0a0d4b58c6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes a connection to a MongoDB data source. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MongoDbConnectionInfo") +@Fluent +public final class MongoDbConnectionInfo extends ConnectionInfo { + /* + * A MongoDB connection string or blob container URL. The user name and + * password can be specified here or in the userName and password + * properties + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /* + * Data source + */ + @JsonProperty(value = "dataSource") + private String dataSource; + + /* + * Whether to encrypt the connection + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * server brand version + */ + @JsonProperty(value = "serverBrandVersion") + private String serverBrandVersion; + + /* + * server version + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /* + * name of the server + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Whether to trust the server certificate + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /* + * The enforceSSL property. + */ + @JsonProperty(value = "enforceSSL") + private Boolean enforceSsl; + + /* + * port for server + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Additional connection settings + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /* + * Authentication type to use for connection + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /** + * Get the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @param connectionString the connectionString value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get the enforceSsl property: The enforceSSL property. + * + * @return the enforceSsl value. + */ + public Boolean enforceSsl() { + return this.enforceSsl; + } + + /** + * Set the enforceSsl property: The enforceSSL property. + * + * @param enforceSsl the enforceSsl value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withEnforceSsl(Boolean enforceSsl) { + this.enforceSsl = enforceSsl; + return this; + } + + /** + * Get the port property: port for server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: port for server. + * + * @param port the port value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (connectionString() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionString in model MongoDbConnectionInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbConnectionInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java new file mode 100644 index 0000000000000..6a2af8c5ed9d8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a database within a MongoDB data source. */ +@Fluent +public final class MongoDbDatabaseInfo extends MongoDbObjectInfo { + /* + * A list of supported collections in a MongoDB database + */ + @JsonProperty(value = "collections", required = true) + private List collections; + + /* + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /** + * Get the collections property: A list of supported collections in a MongoDB database. + * + * @return the collections value. + */ + public List collections() { + return this.collections; + } + + /** + * Set the collections property: A list of supported collections in a MongoDB database. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withCollections(List collections) { + this.collections = collections; + return this; + } + + /** + * Get the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withAverageDocumentSize(long averageDocumentSize) { + super.withAverageDocumentSize(averageDocumentSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withDataSize(long dataSize) { + super.withDataSize(dataSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withDocumentCount(long documentCount) { + super.withDocumentCount(documentCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (collections() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property collections in model MongoDbDatabaseInfo")); + } else { + collections().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbDatabaseInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java new file mode 100644 index 0000000000000..8c960dd679c77 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of a database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Database") +@Fluent +public final class MongoDbDatabaseProgress extends MongoDbProgress { + /* + * The progress of the collections in the database. The keys are the + * unqualified names of the collections + */ + @JsonProperty(value = "collections") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map collections; + + /** + * Get the collections property: The progress of the collections in the database. The keys are the unqualified names + * of the collections. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: The progress of the collections in the database. The keys are the unqualified names + * of the collections. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseProgress object itself. + */ + public MongoDbDatabaseProgress withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (collections() != null) { + collections() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java new file mode 100644 index 0000000000000..894f34cb6a9c3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes how an individual MongoDB database should be migrated. */ +@Fluent +public final class MongoDbDatabaseSettings { + /* + * The collections on the source database to migrate to the target. The + * keys are the unqualified names of the collections. + */ + @JsonProperty(value = "collections", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map collections; + + /* + * 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. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get the collections property: The collections on the source database to migrate to the target. The keys are the + * unqualified names of the collections. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: The collections on the source database to migrate to the target. The keys are the + * unqualified names of the collections. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** + * Get the targetRUs property: 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. + * + * @return the targetRUs value. + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the targetRUs property: 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. + * + * @param targetRUs the targetRUs value to set. + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (collections() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property collections in model MongoDbDatabaseSettings")); + } else { + collections() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbDatabaseSettings.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java new file mode 100644 index 0000000000000..8dec94ce6801d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes an error or warning that occurred during a MongoDB migration. */ +@Fluent +public final class MongoDbError { + /* + * The non-localized, machine-readable code that describes the error or + * warning + */ + @JsonProperty(value = "code") + private String code; + + /* + * The number of times the error or warning has occurred + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * The localized, human-readable message that describes the error or + * warning + */ + @JsonProperty(value = "message") + private String message; + + /* + * The type of error or warning + */ + @JsonProperty(value = "type") + private MongoDbErrorType type; + + /** + * Get the code property: The non-localized, machine-readable code that describes the error or warning. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The non-localized, machine-readable code that describes the error or warning. + * + * @param code the code value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the count property: The number of times the error or warning has occurred. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The number of times the error or warning has occurred. + * + * @param count the count value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the message property: The localized, human-readable message that describes the error or warning. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The localized, human-readable message that describes the error or warning. + * + * @param message the message value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type property: The type of error or warning. + * + * @return the type value. + */ + public MongoDbErrorType type() { + return this.type; + } + + /** + * Set the type property: The type of error or warning. + * + * @param type the type value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withType(MongoDbErrorType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java new file mode 100644 index 0000000000000..9d0c7baaff668 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbErrorType. */ +public final class MongoDbErrorType extends ExpandableStringEnum { + /** Static value Error for MongoDbErrorType. */ + public static final MongoDbErrorType ERROR = fromString("Error"); + + /** Static value ValidationError for MongoDbErrorType. */ + public static final MongoDbErrorType VALIDATION_ERROR = fromString("ValidationError"); + + /** Static value Warning for MongoDbErrorType. */ + public static final MongoDbErrorType WARNING = fromString("Warning"); + + /** + * Creates or finds a MongoDbErrorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbErrorType. + */ + @JsonCreator + public static MongoDbErrorType fromString(String name) { + return fromString(name, MongoDbErrorType.class); + } + + /** @return known MongoDbErrorType values. */ + public static Collection values() { + return values(MongoDbErrorType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java new file mode 100644 index 0000000000000..58a2f96116356 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that finishes a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("finish") +@Fluent +public final class MongoDbFinishCommand extends CommandPropertiesInner { + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbFinishCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbFinishCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbFinishCommand object itself. + */ + public MongoDbFinishCommand withInput(MongoDbFinishCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java new file mode 100644 index 0000000000000..d8f4d0674b99e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the input to the 'finish' MongoDB migration command. */ +@Fluent +public final class MongoDbFinishCommandInput extends MongoDbCommandInput { + /* + * If true, replication for the affected objects will be stopped + * immediately. If false, the migrator will finish replaying queued events + * before finishing the replication. + */ + @JsonProperty(value = "immediate", required = true) + private boolean immediate; + + /** + * Get the immediate property: If true, replication for the affected objects will be stopped immediately. If false, + * the migrator will finish replaying queued events before finishing the replication. + * + * @return the immediate value. + */ + public boolean immediate() { + return this.immediate; + } + + /** + * Set the immediate property: If true, replication for the affected objects will be stopped immediately. If false, + * the migrator will finish replaying queued events before finishing the replication. + * + * @param immediate the immediate value to set. + * @return the MongoDbFinishCommandInput object itself. + */ + public MongoDbFinishCommandInput withImmediate(boolean immediate) { + this.immediate = immediate; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbFinishCommandInput withObjectName(String objectName) { + super.withObjectName(objectName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java new file mode 100644 index 0000000000000..278f98c3b7f34 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of the overall migration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Migration") +@Fluent +public final class MongoDbMigrationProgress extends MongoDbProgress { + /* + * The progress of the databases in the migration. The keys are the names + * of the databases + */ + @JsonProperty(value = "databases") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map databases; + + /** + * Get the databases property: The progress of the databases in the migration. The keys are the names of the + * databases. + * + * @return the databases value. + */ + public Map databases() { + return this.databases; + } + + /** + * Set the databases property: The progress of the databases in the migration. The keys are the names of the + * databases. + * + * @param databases the databases value to set. + * @return the MongoDbMigrationProgress object itself. + */ + public MongoDbMigrationProgress withDatabases(Map databases) { + this.databases = databases; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (databases() != null) { + databases() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java new file mode 100644 index 0000000000000..b0f61ae11c622 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes how a MongoDB data migration should be performed. */ +@Fluent +public final class MongoDbMigrationSettings { + /* + * 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. + */ + @JsonProperty(value = "boostRUs") + private Integer boostRUs; + + /* + * The databases on the source cluster to migrate to the target. The keys + * are the names of the databases. + */ + @JsonProperty(value = "databases", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map databases; + + /* + * Describes how changes will be replicated from the source to the target. + * The default is OneTime. + */ + @JsonProperty(value = "replication") + private MongoDbReplication replication; + + /* + * Settings used to connect to the source cluster + */ + @JsonProperty(value = "source", required = true) + private MongoDbConnectionInfo source; + + /* + * Settings used to connect to the target cluster + */ + @JsonProperty(value = "target", required = true) + private MongoDbConnectionInfo target; + + /* + * Settings used to limit the resource usage of the migration + */ + @JsonProperty(value = "throttling") + private MongoDbThrottlingSettings throttling; + + /** + * Get the boostRUs property: 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. + * + * @return the boostRUs value. + */ + public Integer boostRUs() { + return this.boostRUs; + } + + /** + * Set the boostRUs property: 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. + * + * @param boostRUs the boostRUs value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withBoostRUs(Integer boostRUs) { + this.boostRUs = boostRUs; + return this; + } + + /** + * Get the databases property: The databases on the source cluster to migrate to the target. The keys are the names + * of the databases. + * + * @return the databases value. + */ + public Map databases() { + return this.databases; + } + + /** + * Set the databases property: The databases on the source cluster to migrate to the target. The keys are the names + * of the databases. + * + * @param databases the databases value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withDatabases(Map databases) { + this.databases = databases; + return this; + } + + /** + * Get the replication property: Describes how changes will be replicated from the source to the target. The default + * is OneTime. + * + * @return the replication value. + */ + public MongoDbReplication replication() { + return this.replication; + } + + /** + * Set the replication property: Describes how changes will be replicated from the source to the target. The default + * is OneTime. + * + * @param replication the replication value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withReplication(MongoDbReplication replication) { + this.replication = replication; + return this; + } + + /** + * Get the source property: Settings used to connect to the source cluster. + * + * @return the source value. + */ + public MongoDbConnectionInfo source() { + return this.source; + } + + /** + * Set the source property: Settings used to connect to the source cluster. + * + * @param source the source value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withSource(MongoDbConnectionInfo source) { + this.source = source; + return this; + } + + /** + * Get the target property: Settings used to connect to the target cluster. + * + * @return the target value. + */ + public MongoDbConnectionInfo target() { + return this.target; + } + + /** + * Set the target property: Settings used to connect to the target cluster. + * + * @param target the target value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withTarget(MongoDbConnectionInfo target) { + this.target = target; + return this; + } + + /** + * Get the throttling property: Settings used to limit the resource usage of the migration. + * + * @return the throttling value. + */ + public MongoDbThrottlingSettings throttling() { + return this.throttling; + } + + /** + * Set the throttling property: Settings used to limit the resource usage of the migration. + * + * @param throttling the throttling value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withThrottling(MongoDbThrottlingSettings throttling) { + this.throttling = throttling; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databases() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databases in model MongoDbMigrationSettings")); + } else { + databases() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (source() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model MongoDbMigrationSettings")); + } else { + source().validate(); + } + if (target() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model MongoDbMigrationSettings")); + } else { + target().validate(); + } + if (throttling() != null) { + throttling().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbMigrationSettings.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java new file mode 100644 index 0000000000000..db783f21647a3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbMigrationState. */ +public final class MongoDbMigrationState extends ExpandableStringEnum { + /** Static value NotStarted for MongoDbMigrationState. */ + public static final MongoDbMigrationState NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInput for MongoDbMigrationState. */ + public static final MongoDbMigrationState VALIDATING_INPUT = fromString("ValidatingInput"); + + /** Static value Initializing for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIALIZING = fromString("Initializing"); + + /** Static value Restarting for MongoDbMigrationState. */ + public static final MongoDbMigrationState RESTARTING = fromString("Restarting"); + + /** Static value Copying for MongoDbMigrationState. */ + public static final MongoDbMigrationState COPYING = fromString("Copying"); + + /** Static value InitialReplay for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIAL_REPLAY = fromString("InitialReplay"); + + /** Static value Replaying for MongoDbMigrationState. */ + public static final MongoDbMigrationState REPLAYING = fromString("Replaying"); + + /** Static value Finalizing for MongoDbMigrationState. */ + public static final MongoDbMigrationState FINALIZING = fromString("Finalizing"); + + /** Static value Complete for MongoDbMigrationState. */ + public static final MongoDbMigrationState COMPLETE = fromString("Complete"); + + /** Static value Canceled for MongoDbMigrationState. */ + public static final MongoDbMigrationState CANCELED = fromString("Canceled"); + + /** Static value Failed for MongoDbMigrationState. */ + public static final MongoDbMigrationState FAILED = fromString("Failed"); + + /** + * Creates or finds a MongoDbMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbMigrationState. + */ + @JsonCreator + public static MongoDbMigrationState fromString(String name) { + return fromString(name, MongoDbMigrationState.class); + } + + /** @return known MongoDbMigrationState values. */ + public static Collection values() { + return values(MongoDbMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java new file mode 100644 index 0000000000000..a3178bddbc65e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a database or collection within a MongoDB data source. */ +@Fluent +public class MongoDbObjectInfo { + /* + * The average document size, or -1 if the average size is unknown + */ + @JsonProperty(value = "averageDocumentSize", required = true) + private long averageDocumentSize; + + /* + * The estimated total data size, in bytes, or -1 if the size is unknown. + */ + @JsonProperty(value = "dataSize", required = true) + private long dataSize; + + /* + * The estimated total number of documents, or -1 if the document count is + * unknown + */ + @JsonProperty(value = "documentCount", required = true) + private long documentCount; + + /* + * The unqualified name of the database or collection + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The qualified name of the database or collection. For a collection, this + * is the database-qualified name. + */ + @JsonProperty(value = "qualifiedName", required = true) + private String qualifiedName; + + /** + * Get the averageDocumentSize property: The average document size, or -1 if the average size is unknown. + * + * @return the averageDocumentSize value. + */ + public long averageDocumentSize() { + return this.averageDocumentSize; + } + + /** + * Set the averageDocumentSize property: The average document size, or -1 if the average size is unknown. + * + * @param averageDocumentSize the averageDocumentSize value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withAverageDocumentSize(long averageDocumentSize) { + this.averageDocumentSize = averageDocumentSize; + return this; + } + + /** + * Get the dataSize property: The estimated total data size, in bytes, or -1 if the size is unknown. + * + * @return the dataSize value. + */ + public long dataSize() { + return this.dataSize; + } + + /** + * Set the dataSize property: The estimated total data size, in bytes, or -1 if the size is unknown. + * + * @param dataSize the dataSize value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDataSize(long dataSize) { + this.dataSize = dataSize; + return this; + } + + /** + * Get the documentCount property: The estimated total number of documents, or -1 if the document count is unknown. + * + * @return the documentCount value. + */ + public long documentCount() { + return this.documentCount; + } + + /** + * Set the documentCount property: The estimated total number of documents, or -1 if the document count is unknown. + * + * @param documentCount the documentCount value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDocumentCount(long documentCount) { + this.documentCount = documentCount; + return this; + } + + /** + * Get the name property: The unqualified name of the database or collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unqualified name of the database or collection. + * + * @param name the name value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualifiedName property: The qualified name of the database or collection. For a collection, this is the + * database-qualified name. + * + * @return the qualifiedName value. + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualifiedName property: The qualified name of the database or collection. For a collection, this is the + * database-qualified name. + * + * @param qualifiedName the qualifiedName value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model MongoDbObjectInfo")); + } + if (qualifiedName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property qualifiedName in model MongoDbObjectInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbObjectInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java new file mode 100644 index 0000000000000..c6de8b6c4189b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Base class for MongoDB migration outputs. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MongoDbProgress.class) +@JsonTypeName("MongoDbProgress") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Collection", value = MongoDbCollectionProgress.class), + @JsonSubTypes.Type(name = "Database", value = MongoDbDatabaseProgress.class), + @JsonSubTypes.Type(name = "Migration", value = MongoDbMigrationProgress.class) +}) +@Fluent +public class MongoDbProgress { + /* + * The number of document bytes copied during the Copying stage + */ + @JsonProperty(value = "bytesCopied", required = true) + private long bytesCopied; + + /* + * The number of documents copied during the Copying stage + */ + @JsonProperty(value = "documentsCopied", required = true) + private long documentsCopied; + + /* + * The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan + * format) + */ + @JsonProperty(value = "elapsedTime", required = true) + private String elapsedTime; + + /* + * The errors and warnings that have occurred for the current object. The + * keys are the error codes. + */ + @JsonProperty(value = "errors", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map errors; + + /* + * The number of oplog events awaiting replay + */ + @JsonProperty(value = "eventsPending", required = true) + private long eventsPending; + + /* + * The number of oplog events replayed so far + */ + @JsonProperty(value = "eventsReplayed", required = true) + private long eventsReplayed; + + /* + * The timestamp of the last oplog event received, or null if no oplog + * event has been received yet + */ + @JsonProperty(value = "lastEventTime") + private OffsetDateTime lastEventTime; + + /* + * The timestamp of the last oplog event replayed, or null if no oplog + * event has been replayed yet + */ + @JsonProperty(value = "lastReplayTime") + private OffsetDateTime lastReplayTime; + + /* + * 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. + */ + @JsonProperty(value = "name") + private String 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. + */ + @JsonProperty(value = "qualifiedName") + private String qualifiedName; + + /* + * The state property. + */ + @JsonProperty(value = "state", required = true) + private MongoDbMigrationState state; + + /* + * The total number of document bytes on the source at the beginning of the + * Copying stage, or -1 if the total size was unknown + */ + @JsonProperty(value = "totalBytes", required = true) + private long totalBytes; + + /* + * The total number of documents on the source at the beginning of the + * Copying stage, or -1 if the total count was unknown + */ + @JsonProperty(value = "totalDocuments", required = true) + private long totalDocuments; + + /** + * Get the bytesCopied property: The number of document bytes copied during the Copying stage. + * + * @return the bytesCopied value. + */ + public long bytesCopied() { + return this.bytesCopied; + } + + /** + * Set the bytesCopied property: The number of document bytes copied during the Copying stage. + * + * @param bytesCopied the bytesCopied value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withBytesCopied(long bytesCopied) { + this.bytesCopied = bytesCopied; + return this; + } + + /** + * Get the documentsCopied property: The number of documents copied during the Copying stage. + * + * @return the documentsCopied value. + */ + public long documentsCopied() { + return this.documentsCopied; + } + + /** + * Set the documentsCopied property: The number of documents copied during the Copying stage. + * + * @param documentsCopied the documentsCopied value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withDocumentsCopied(long documentsCopied) { + this.documentsCopied = documentsCopied; + return this; + } + + /** + * Get the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @return the elapsedTime value. + */ + public String elapsedTime() { + return this.elapsedTime; + } + + /** + * Set the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @param elapsedTime the elapsedTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withElapsedTime(String elapsedTime) { + this.elapsedTime = elapsedTime; + return this; + } + + /** + * Get the errors property: The errors and warnings that have occurred for the current object. The keys are the + * error codes. + * + * @return the errors value. + */ + public Map errors() { + return this.errors; + } + + /** + * Set the errors property: The errors and warnings that have occurred for the current object. The keys are the + * error codes. + * + * @param errors the errors value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withErrors(Map errors) { + this.errors = errors; + return this; + } + + /** + * Get the eventsPending property: The number of oplog events awaiting replay. + * + * @return the eventsPending value. + */ + public long eventsPending() { + return this.eventsPending; + } + + /** + * Set the eventsPending property: The number of oplog events awaiting replay. + * + * @param eventsPending the eventsPending value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsPending(long eventsPending) { + this.eventsPending = eventsPending; + return this; + } + + /** + * Get the eventsReplayed property: The number of oplog events replayed so far. + * + * @return the eventsReplayed value. + */ + public long eventsReplayed() { + return this.eventsReplayed; + } + + /** + * Set the eventsReplayed property: The number of oplog events replayed so far. + * + * @param eventsReplayed the eventsReplayed value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsReplayed(long eventsReplayed) { + this.eventsReplayed = eventsReplayed; + return this; + } + + /** + * Get the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has + * been received yet. + * + * @return the lastEventTime value. + */ + public OffsetDateTime lastEventTime() { + return this.lastEventTime; + } + + /** + * Set the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has + * been received yet. + * + * @param lastEventTime the lastEventTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastEventTime(OffsetDateTime lastEventTime) { + this.lastEventTime = lastEventTime; + return this; + } + + /** + * Get the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has + * been replayed yet. + * + * @return the lastReplayTime value. + */ + public OffsetDateTime lastReplayTime() { + return this.lastReplayTime; + } + + /** + * Set the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has + * been replayed yet. + * + * @param lastReplayTime the lastReplayTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + this.lastReplayTime = lastReplayTime; + return this; + } + + /** + * Get the name property: 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. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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. + * + * @param name the name value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualifiedName property: 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. + * + * @return the qualifiedName value. + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualifiedName property: 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. + * + * @param qualifiedName the qualifiedName value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public MongoDbMigrationState state() { + return this.state; + } + + /** + * Set the state property: The state property. + * + * @param state the state value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withState(MongoDbMigrationState state) { + this.state = state; + return this; + } + + /** + * Get the totalBytes property: The total number of document bytes on the source at the beginning of the Copying + * stage, or -1 if the total size was unknown. + * + * @return the totalBytes value. + */ + public long totalBytes() { + return this.totalBytes; + } + + /** + * Set the totalBytes property: The total number of document bytes on the source at the beginning of the Copying + * stage, or -1 if the total size was unknown. + * + * @param totalBytes the totalBytes value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalBytes(long totalBytes) { + this.totalBytes = totalBytes; + return this; + } + + /** + * Get the totalDocuments property: The total number of documents on the source at the beginning of the Copying + * stage, or -1 if the total count was unknown. + * + * @return the totalDocuments value. + */ + public long totalDocuments() { + return this.totalDocuments; + } + + /** + * Set the totalDocuments property: The total number of documents on the source at the beginning of the Copying + * stage, or -1 if the total count was unknown. + * + * @param totalDocuments the totalDocuments value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalDocuments(long totalDocuments) { + this.totalDocuments = totalDocuments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (elapsedTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property elapsedTime in model MongoDbProgress")); + } + if (errors() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property errors in model MongoDbProgress")); + } else { + errors() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model MongoDbProgress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbProgress.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java new file mode 100644 index 0000000000000..c2b4d188d7dcb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbProgressResultType. */ +public final class MongoDbProgressResultType extends ExpandableStringEnum { + /** Static value Migration for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType MIGRATION = fromString("Migration"); + + /** Static value Database for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType DATABASE = fromString("Database"); + + /** Static value Collection for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType COLLECTION = fromString("Collection"); + + /** + * Creates or finds a MongoDbProgressResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbProgressResultType. + */ + @JsonCreator + public static MongoDbProgressResultType fromString(String name) { + return fromString(name, MongoDbProgressResultType.class); + } + + /** @return known MongoDbProgressResultType values. */ + public static Collection values() { + return values(MongoDbProgressResultType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java new file mode 100644 index 0000000000000..4fcd63d10475b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbReplication. */ +public final class MongoDbReplication extends ExpandableStringEnum { + /** Static value Disabled for MongoDbReplication. */ + public static final MongoDbReplication DISABLED = fromString("Disabled"); + + /** Static value OneTime for MongoDbReplication. */ + public static final MongoDbReplication ONE_TIME = fromString("OneTime"); + + /** Static value Continuous for MongoDbReplication. */ + public static final MongoDbReplication CONTINUOUS = fromString("Continuous"); + + /** + * Creates or finds a MongoDbReplication from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbReplication. + */ + @JsonCreator + public static MongoDbReplication fromString(String name) { + return fromString(name, MongoDbReplication.class); + } + + /** @return known MongoDbReplication values. */ + public static Collection values() { + return values(MongoDbReplication.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java new file mode 100644 index 0000000000000..f776da4f7701d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that restarts a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("restart") +@Fluent +public final class MongoDbRestartCommand extends CommandPropertiesInner { + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbRestartCommand object itself. + */ + public MongoDbRestartCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java new file mode 100644 index 0000000000000..9a2d420f627d8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a field reference within a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyField { + /* + * The name of the field + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The field ordering + */ + @JsonProperty(value = "order", required = true) + private MongoDbShardKeyOrder order; + + /** + * Get the name property: The name of the field. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the field. + * + * @param name the name value to set. + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withName(String name) { + this.name = name; + return this; + } + + /** + * Get the order property: The field ordering. + * + * @return the order value. + */ + public MongoDbShardKeyOrder order() { + return this.order; + } + + /** + * Set the order property: The field ordering. + * + * @param order the order value to set. + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withOrder(MongoDbShardKeyOrder order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model MongoDbShardKeyField")); + } + if (order() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property order in model MongoDbShardKeyField")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeyField.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java new file mode 100644 index 0000000000000..87daccb0d7150 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyInfo { + /* + * The fields within the shard key + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /* + * Whether the shard key is unique + */ + @JsonProperty(value = "isUnique", required = true) + private boolean isUnique; + + /** + * Get the fields property: The fields within the shard key. + * + * @return the fields value. + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields property: The fields within the shard key. + * + * @param fields the fields value to set. + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get the isUnique property: Whether the shard key is unique. + * + * @return the isUnique value. + */ + public boolean isUnique() { + return this.isUnique; + } + + /** + * Set the isUnique property: Whether the shard key is unique. + * + * @param isUnique the isUnique value to set. + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withIsUnique(boolean isUnique) { + this.isUnique = isUnique; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fields() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property fields in model MongoDbShardKeyInfo")); + } else { + fields().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeyInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java new file mode 100644 index 0000000000000..7910d7390f7b4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbShardKeyOrder. */ +public final class MongoDbShardKeyOrder extends ExpandableStringEnum { + /** Static value Forward for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder FORWARD = fromString("Forward"); + + /** Static value Reverse for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder REVERSE = fromString("Reverse"); + + /** Static value Hashed for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder HASHED = fromString("Hashed"); + + /** + * Creates or finds a MongoDbShardKeyOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbShardKeyOrder. + */ + @JsonCreator + public static MongoDbShardKeyOrder fromString(String name) { + return fromString(name, MongoDbShardKeyOrder.class); + } + + /** @return known MongoDbShardKeyOrder values. */ + public static Collection values() { + return values(MongoDbShardKeyOrder.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java new file mode 100644 index 0000000000000..420f809409498 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeySetting { + /* + * The fields within the shard key + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /* + * Whether the shard key is unique + */ + @JsonProperty(value = "isUnique") + private Boolean isUnique; + + /** + * Get the fields property: The fields within the shard key. + * + * @return the fields value. + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields property: The fields within the shard key. + * + * @param fields the fields value to set. + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get the isUnique property: Whether the shard key is unique. + * + * @return the isUnique value. + */ + public Boolean isUnique() { + return this.isUnique; + } + + /** + * Set the isUnique property: Whether the shard key is unique. + * + * @param isUnique the isUnique value to set. + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withIsUnique(Boolean isUnique) { + this.isUnique = isUnique; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fields() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property fields in model MongoDbShardKeySetting")); + } else { + fields().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeySetting.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java new file mode 100644 index 0000000000000..400ff1373707b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies resource limits for the migration. */ +@Fluent +public final class MongoDbThrottlingSettings { + /* + * The percentage of CPU time that the migrator will try to avoid using, + * from 0 to 100 + */ + @JsonProperty(value = "minFreeCpu") + private Integer minFreeCpu; + + /* + * The number of megabytes of RAM that the migrator will try to avoid using + */ + @JsonProperty(value = "minFreeMemoryMb") + private Integer minFreeMemoryMb; + + /* + * The maximum number of work items (e.g. collection copies) that will be + * processed in parallel + */ + @JsonProperty(value = "maxParallelism") + private Integer maxParallelism; + + /** + * Get the minFreeCpu property: The percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @return the minFreeCpu value. + */ + public Integer minFreeCpu() { + return this.minFreeCpu; + } + + /** + * Set the minFreeCpu property: The percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @param minFreeCpu the minFreeCpu value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeCpu(Integer minFreeCpu) { + this.minFreeCpu = minFreeCpu; + return this; + } + + /** + * Get the minFreeMemoryMb property: The number of megabytes of RAM that the migrator will try to avoid using. + * + * @return the minFreeMemoryMb value. + */ + public Integer minFreeMemoryMb() { + return this.minFreeMemoryMb; + } + + /** + * Set the minFreeMemoryMb property: The number of megabytes of RAM that the migrator will try to avoid using. + * + * @param minFreeMemoryMb the minFreeMemoryMb value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeMemoryMb(Integer minFreeMemoryMb) { + this.minFreeMemoryMb = minFreeMemoryMb; + return this; + } + + /** + * Get the maxParallelism property: The maximum number of work items (e.g. collection copies) that will be processed + * in parallel. + * + * @return the maxParallelism value. + */ + public Integer maxParallelism() { + return this.maxParallelism; + } + + /** + * Set the maxParallelism property: The maximum number of work items (e.g. collection copies) that will be processed + * in parallel. + * + * @param maxParallelism the maxParallelism value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMaxParallelism(Integer maxParallelism) { + this.maxParallelism = maxParallelism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java index 518b33307b0b5..d4407541f8068 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,20 +15,42 @@ @JsonTypeName("MySqlConnectionInfo") @Fluent public final class MySqlConnectionInfo extends ConnectionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MySqlConnectionInfo.class); - /* * Name of the server */ @JsonProperty(value = "serverName", required = true) private String serverName; + /* + * Data source + */ + @JsonProperty(value = "dataSource") + private String dataSource; + /* * Port for Server */ @JsonProperty(value = "port", required = true) private int port; + /* + * Whether to encrypt the connection + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * Authentication type to use for connection + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /* + * Additional connection settings + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + /** * Get the serverName property: Name of the server. * @@ -50,6 +71,26 @@ public MySqlConnectionInfo withServerName(String serverName) { return this; } + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + /** * Get the port property: Port for Server. * @@ -70,6 +111,66 @@ public MySqlConnectionInfo withPort(int port) { return this; } + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + /** {@inheritDoc} */ @Override public MySqlConnectionInfo withUsername(String username) { @@ -93,9 +194,11 @@ public MySqlConnectionInfo withPassword(String password) { public void validate() { super.validate(); if (serverName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property serverName in model MySqlConnectionInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(MySqlConnectionInfo.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java index 55bf91ac9921d..f6693a7ead640 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A resource type and proposed name. */ @Fluent public final class NameAvailabilityRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityRequest.class); - /* * The proposed resource name */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java new file mode 100644 index 0000000000000..cb9db46446f90 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The NodeMonitoringData model. */ +@Immutable +public final class NodeMonitoringData { + /* + * Unmatched properties from the message are deserialized in this + * collection. + */ + @JsonProperty(value = "additionalProperties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map additionalProperties; + + /* + * Name of the integration runtime node. + */ + @JsonProperty(value = "nodeName", access = JsonProperty.Access.WRITE_ONLY) + private String nodeName; + + /* + * Available memory (MB) on the integration runtime node. + */ + @JsonProperty(value = "availableMemoryInMB", access = JsonProperty.Access.WRITE_ONLY) + private Integer availableMemoryInMB; + + /* + * CPU percentage on the integration runtime node. + */ + @JsonProperty(value = "cpuUtilization", access = JsonProperty.Access.WRITE_ONLY) + private Integer cpuUtilization; + + /* + * Maximum concurrent jobs on the integration runtime node. + */ + @JsonProperty(value = "concurrentJobsLimit", access = JsonProperty.Access.WRITE_ONLY) + private Integer concurrentJobsLimit; + + /* + * The number of jobs currently running on the integration runtime node. + */ + @JsonProperty(value = "concurrentJobsRunning", access = JsonProperty.Access.WRITE_ONLY) + private Integer concurrentJobsRunning; + + /* + * The maximum concurrent jobs in this integration runtime. + */ + @JsonProperty(value = "maxConcurrentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxConcurrentJobs; + + /* + * Sent bytes on the integration runtime node. + */ + @JsonProperty(value = "sentBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double sentBytes; + + /* + * Received bytes on the integration runtime node. + */ + @JsonProperty(value = "receivedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double receivedBytes; + + /** + * Get the additionalProperties property: Unmatched properties from the message are deserialized in this collection. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Get the nodeName property: Name of the integration runtime node. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Get the availableMemoryInMB property: Available memory (MB) on the integration runtime node. + * + * @return the availableMemoryInMB value. + */ + public Integer availableMemoryInMB() { + return this.availableMemoryInMB; + } + + /** + * Get the cpuUtilization property: CPU percentage on the integration runtime node. + * + * @return the cpuUtilization value. + */ + public Integer cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the concurrentJobsLimit property: Maximum concurrent jobs on the integration runtime node. + * + * @return the concurrentJobsLimit value. + */ + public Integer concurrentJobsLimit() { + return this.concurrentJobsLimit; + } + + /** + * Get the concurrentJobsRunning property: The number of jobs currently running on the integration runtime node. + * + * @return the concurrentJobsRunning value. + */ + public Integer concurrentJobsRunning() { + return this.concurrentJobsRunning; + } + + /** + * Get the maxConcurrentJobs property: The maximum concurrent jobs in this integration runtime. + * + * @return the maxConcurrentJobs value. + */ + public Integer maxConcurrentJobs() { + return this.maxConcurrentJobs; + } + + /** + * Get the sentBytes property: Sent bytes on the integration runtime node. + * + * @return the sentBytes value. + */ + public Double sentBytes() { + return this.sentBytes; + } + + /** + * Get the receivedBytes property: Received bytes on the integration runtime node. + * + * @return the receivedBytes value. + */ + public Double receivedBytes() { + return this.receivedBytes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java deleted file mode 100644 index 525bb1fc56b35..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines metadata for table to be migrated. */ -@Fluent -public final class NonSqlDataMigrationTable { - @JsonIgnore private final ClientLogger logger = new ClientLogger(NonSqlDataMigrationTable.class); - - /* - * Source table name - */ - @JsonProperty(value = "sourceName") - private String sourceName; - - /** - * Get the sourceName property: Source table name. - * - * @return the sourceName value. - */ - public String sourceName() { - return this.sourceName; - } - - /** - * Set the sourceName property: Source table name. - * - * @param sourceName the sourceName value to set. - * @return the NonSqlDataMigrationTable object itself. - */ - public NonSqlDataMigrationTable withSourceName(String sourceName) { - this.sourceName = sourceName; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java new file mode 100644 index 0000000000000..6d534d98c544c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Offline configuration. */ +@Fluent +public final class OfflineConfiguration { + /* + * Offline migration + */ + @JsonProperty(value = "offline") + private Boolean offline; + + /* + * 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. + */ + @JsonProperty(value = "lastBackupName") + private String lastBackupName; + + /** + * Get the offline property: Offline migration. + * + * @return the offline value. + */ + public Boolean offline() { + return this.offline; + } + + /** + * Set the offline property: Offline migration. + * + * @param offline the offline value to set. + * @return the OfflineConfiguration object itself. + */ + public OfflineConfiguration withOffline(Boolean offline) { + this.offline = offline; + return this; + } + + /** + * Get the lastBackupName property: 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. + * + * @return the lastBackupName value. + */ + public String lastBackupName() { + return this.lastBackupName; + } + + /** + * Set the lastBackupName property: 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. + * + * @param lastBackupName the lastBackupName value to set. + * @return the OfflineConfiguration object itself. + */ + public OfflineConfiguration withLastBackupName(String lastBackupName) { + this.lastBackupName = lastBackupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java new file mode 100644 index 0000000000000..f0fe5d9560da2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the request to list SQL operations. */ +@Immutable +public final class OperationListResult { + /* + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java new file mode 100644 index 0000000000000..50aeefae607ff --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationOrigin. */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationOrigin. + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** @return known OperationOrigin values. */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java index 6e63337c3a478..c33d209611e09 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java @@ -10,22 +10,22 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java new file mode 100644 index 0000000000000..e8a4b24ee6c69 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import java.util.Map; + +/** An immutable client-side representation of OperationsDefinition. */ +public interface OperationsDefinition { + /** + * Gets the name property: The name property. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: The display property. + * + * @return the display value. + */ + OperationsDisplayDefinition display(); + + /** + * Gets the origin property: The origin property. + * + * @return the origin value. + */ + OperationOrigin origin(); + + /** + * Gets the properties property: Dictionary of <AnyObject>. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner object. + * + * @return the inner object. + */ + OperationsDefinitionInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java new file mode 100644 index 0000000000000..8441fc88e07b9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsDisplayDefinition model. */ +@Immutable +public final class OperationsDisplayDefinition { + /* + * The provider property. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The resource property. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The operation property. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The description property. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The provider property. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The operation property. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java new file mode 100644 index 0000000000000..86191347ceabc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information for connecting to Oracle server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("OracleConnectionInfo") +@Fluent +public final class OracleConnectionInfo extends ConnectionInfo { + /* + * EZConnect or TNSName connection string. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /* + * name of the server + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * server version + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /* + * port for server + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Authentication type to use for connection + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /** + * Get the dataSource property: EZConnect or TNSName connection string. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: EZConnect or TNSName connection string. + * + * @param dataSource the dataSource value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the port property: port for server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: port for server. + * + * @param port the port value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** {@inheritDoc} */ + @Override + public OracleConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public OracleConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataSource in model OracleConnectionInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OracleConnectionInfo.class); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java new file mode 100644 index 0000000000000..74d7f497e848f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about an Oracle OCI driver. */ +@Immutable +public final class OracleOciDriverInfo { + /* + * The name of the driver package + */ + @JsonProperty(value = "driverName", access = JsonProperty.Access.WRITE_ONLY) + private String driverName; + + /* + * The size in bytes of the driver package + */ + @JsonProperty(value = "driverSize", access = JsonProperty.Access.WRITE_ONLY) + private String driverSize; + + /* + * The MD5 Base64 encoded checksum for the driver package. + */ + @JsonProperty(value = "archiveChecksum", access = JsonProperty.Access.WRITE_ONLY) + private String archiveChecksum; + + /* + * The checksum for the driver package provided by Oracle. + */ + @JsonProperty(value = "oracleChecksum", access = JsonProperty.Access.WRITE_ONLY) + private String oracleChecksum; + + /* + * Version listed in the OCI assembly 'oci.dll' + */ + @JsonProperty(value = "assemblyVersion", access = JsonProperty.Access.WRITE_ONLY) + private String assemblyVersion; + + /* + * List of Oracle database versions supported by this driver. Only major + * minor of the version is listed. + */ + @JsonProperty(value = "supportedOracleVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedOracleVersions; + + /** + * Get the driverName property: The name of the driver package. + * + * @return the driverName value. + */ + public String driverName() { + return this.driverName; + } + + /** + * Get the driverSize property: The size in bytes of the driver package. + * + * @return the driverSize value. + */ + public String driverSize() { + return this.driverSize; + } + + /** + * Get the archiveChecksum property: The MD5 Base64 encoded checksum for the driver package. + * + * @return the archiveChecksum value. + */ + public String archiveChecksum() { + return this.archiveChecksum; + } + + /** + * Get the oracleChecksum property: The checksum for the driver package provided by Oracle. + * + * @return the oracleChecksum value. + */ + public String oracleChecksum() { + return this.oracleChecksum; + } + + /** + * Get the assemblyVersion property: Version listed in the OCI assembly 'oci.dll'. + * + * @return the assemblyVersion value. + */ + public String assemblyVersion() { + return this.assemblyVersion; + } + + /** + * Get the supportedOracleVersions property: List of Oracle database versions supported by this driver. Only major + * minor of the version is listed. + * + * @return the supportedOracleVersions value. + */ + public List supportedOracleVersions() { + return this.supportedOracleVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java index f1664b46a21bc..c96143654a2d1 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Information of orphaned users on the SQL server database. */ @Fluent public final class OrphanedUserInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrphanedUserInfo.class); - /* * Name of the orphaned user */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java index c5d11ea8e2bfb..ee778e94d5d2c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,14 +15,24 @@ @JsonTypeName("PostgreSqlConnectionInfo") @Fluent public final class PostgreSqlConnectionInfo extends ConnectionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PostgreSqlConnectionInfo.class); - /* * Name of the server */ @JsonProperty(value = "serverName", required = true) private String serverName; + /* + * Data source + */ + @JsonProperty(value = "dataSource") + private String dataSource; + + /* + * server version + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + /* * Name of the database */ @@ -36,6 +45,36 @@ public final class PostgreSqlConnectionInfo extends ConnectionInfo { @JsonProperty(value = "port", required = true) private int port; + /* + * Whether to encrypt the connection + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * Whether to trust the server certificate + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /* + * Additional connection settings + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /* + * server brand version + */ + @JsonProperty(value = "serverBrandVersion") + private String serverBrandVersion; + + /* + * Authentication type to use for connection + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + /** * Get the serverName property: Name of the server. * @@ -56,6 +95,46 @@ public PostgreSqlConnectionInfo withServerName(String serverName) { return this; } + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + /** * Get the databaseName property: Name of the database. * @@ -96,6 +175,106 @@ public PostgreSqlConnectionInfo withPort(int port) { return this; } + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + /** {@inheritDoc} */ @Override public PostgreSqlConnectionInfo withUsername(String username) { @@ -119,10 +298,12 @@ public PostgreSqlConnectionInfo withPassword(String password) { public void validate() { super.validate(); if (serverName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property serverName in model PostgreSqlConnectionInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PostgreSqlConnectionInfo.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java index 2705bd5a413f4..4035c797ce369 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; import java.time.OffsetDateTime; @@ -48,6 +49,20 @@ public interface Project { */ Map tags(); + /** + * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the sourcePlatform property: Source platform for the project. * @@ -55,6 +70,14 @@ public interface Project { */ ProjectSourcePlatform sourcePlatform(); + /** + * Gets the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used + * to connect to the target Azure resource. + * + * @return the azureAuthenticationInfo value. + */ + AzureActiveDirectoryApp azureAuthenticationInfo(); + /** * Gets the targetPlatform property: Target platform for the project. * @@ -165,7 +188,9 @@ interface WithParentResource { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, DefinitionStages.WithSourcePlatform, + DefinitionStages.WithAzureAuthenticationInfo, DefinitionStages.WithTargetPlatform, DefinitionStages.WithSourceConnectionInfo, DefinitionStages.WithTargetConnectionInfo, @@ -195,6 +220,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Project definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } /** The stage of the Project definition allowing to specify sourcePlatform. */ interface WithSourcePlatform { /** @@ -205,6 +240,18 @@ interface WithSourcePlatform { */ WithCreate withSourcePlatform(ProjectSourcePlatform sourcePlatform); } + /** The stage of the Project definition allowing to specify azureAuthenticationInfo. */ + interface WithAzureAuthenticationInfo { + /** + * Specifies the azureAuthenticationInfo property: Field that defines the Azure active directory application + * info, used to connect to the target Azure resource. + * + * @param azureAuthenticationInfo Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * @return the next definition stage. + */ + WithCreate withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo); + } /** The stage of the Project definition allowing to specify targetPlatform. */ interface WithTargetPlatform { /** @@ -256,7 +303,9 @@ interface WithDatabasesInfo { /** The template for Project update. */ interface Update extends UpdateStages.WithTags, + UpdateStages.WithEtag, UpdateStages.WithSourcePlatform, + UpdateStages.WithAzureAuthenticationInfo, UpdateStages.WithTargetPlatform, UpdateStages.WithSourceConnectionInfo, UpdateStages.WithTargetConnectionInfo, @@ -288,6 +337,16 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Project update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } /** The stage of the Project update allowing to specify sourcePlatform. */ interface WithSourcePlatform { /** @@ -298,6 +357,18 @@ interface WithSourcePlatform { */ Update withSourcePlatform(ProjectSourcePlatform sourcePlatform); } + /** The stage of the Project update allowing to specify azureAuthenticationInfo. */ + interface WithAzureAuthenticationInfo { + /** + * Specifies the azureAuthenticationInfo property: Field that defines the Azure active directory application + * info, used to connect to the target Azure resource. + * + * @param azureAuthenticationInfo Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * @return the next definition stage. + */ + Update withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo); + } /** The stage of the Project update allowing to specify targetPlatform. */ interface WithTargetPlatform { /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java new file mode 100644 index 0000000000000..11913e542535b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; + +/** An immutable client-side representation of ProjectFile. */ +public interface ProjectFile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the properties property: Custom file properties. + * + * @return the properties value. + */ + ProjectFileProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner object. + * + * @return the inner object. + */ + ProjectFileInner innerModel(); + + /** The entirety of the ProjectFile definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProjectFile definition stages. */ + interface DefinitionStages { + /** The first stage of the ProjectFile definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProjectFile definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies groupName, serviceName, projectName. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @return the next definition stage. + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + /** + * The stage of the ProjectFile definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProjectFile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProjectFile create(Context context); + } + /** The stage of the ProjectFile definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the ProjectFile definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom file properties. + * + * @param properties Custom file properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectFileProperties properties); + } + } + /** + * Begins update for the ProjectFile resource. + * + * @return the stage of resource update. + */ + ProjectFile.Update update(); + + /** The template for ProjectFile update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProjectFile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProjectFile apply(Context context); + } + /** The ProjectFile update stages. */ + interface UpdateStages { + /** The stage of the ProjectFile update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the ProjectFile update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom file properties. + * + * @param properties Custom file properties. + * @return the next definition stage. + */ + Update withProperties(ProjectFileProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProjectFile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProjectFile refresh(Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo read(); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWithResponse(Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo readWrite(); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWriteWithResponse(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java new file mode 100644 index 0000000000000..284614fd6c61b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Base class for file properties. */ +@Fluent +public final class ProjectFileProperties { + /* + * Optional File extension. If submitted it should not have a leading + * period and must match the extension from filePath. + */ + @JsonProperty(value = "extension") + private String extension; + + /* + * Relative path of this file resource. This property can be set when + * creating or updating the file resource. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /* + * Modification DateTime. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * File content type. This property can be modified to reflect the file + * content type. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /* + * File size. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private Long size; + + /** + * Get the extension property: Optional File extension. If submitted it should not have a leading period and must + * match the extension from filePath. + * + * @return the extension value. + */ + public String extension() { + return this.extension; + } + + /** + * Set the extension property: Optional File extension. If submitted it should not have a leading period and must + * match the extension from filePath. + * + * @param extension the extension value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withExtension(String extension) { + this.extension = extension; + return this; + } + + /** + * Get the filePath property: Relative path of this file resource. This property can be set when creating or + * updating the file resource. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: Relative path of this file resource. This property can be set when creating or + * updating the file resource. + * + * @param filePath the filePath value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the lastModified property: Modification DateTime. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the mediaType property: File content type. This property can be modified to reflect the file content type. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: File content type. This property can be modified to reflect the file content type. + * + * @param mediaType the mediaType value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the size property: File size. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java index 16162653a1c9e..9719308cafa04 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** OData page of project resources. */ @Fluent public final class ProjectList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectList.class); - /* * List of projects */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java index cc69f0e4fa6c7..b9c3605e7db08 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java @@ -13,6 +13,15 @@ public final class ProjectSourcePlatform extends ExpandableStringEnum cancelWithResponse(Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + CommandProperties command(CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response}. + */ + Response commandWithResponse(CommandPropertiesInner parameters, Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java index 1d11ffac00781..1363094edc7f5 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java @@ -4,15 +4,16 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** * Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. @@ -24,7 +25,11 @@ defaultImpl = ProjectTaskProperties.class) @JsonTypeName("ProjectTaskProperties") @JsonSubTypes({ - @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "MigrateSchemaSqlServerSqlDb", value = MigrateSchemaSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Check.OCI", value = CheckOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Upload.OCI", value = UploadOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Install.OCI", value = InstallOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Connect.MongoDb", value = ConnectToMongoDbTaskProperties.class), @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class), @JsonSubTypes.Type( name = "ConnectToSource.SqlServer.Sync", @@ -32,13 +37,21 @@ @JsonSubTypes.Type( name = "ConnectToSource.PostgreSql.Sync", value = ConnectToSourcePostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.Oracle.Sync", value = ConnectToSourceOracleSyncTaskProperties.class), @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb.Sync", value = ConnectToTargetSqlDbSyncTaskProperties.class), @JsonSubTypes.Type( name = "ConnectToTarget.AzureDbForPostgreSql.Sync", value = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", + value = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.class), @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), @JsonSubTypes.Type(name = "GetUserTables.AzureSqlDb.Sync", value = GetUserTablesSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTablesOracle", value = GetUserTablesOracleTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTablesPostgreSql", value = GetUserTablesPostgreSqlTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTablesMySql", value = GetUserTablesMySqlTaskProperties.class), @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), @JsonSubTypes.Type( name = "ConnectToTarget.AzureSqlDbMI.Sync.LRS", @@ -46,6 +59,7 @@ @JsonSubTypes.Type( name = "ConnectToTarget.AzureDbForMySql", value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), @JsonSubTypes.Type( name = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", @@ -58,8 +72,14 @@ name = "Migrate.MySql.AzureDbForMySql.Sync", value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), @JsonSubTypes.Type( - name = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync", + name = "Migrate.MySql.AzureDbForMySql", + value = MigrateMySqlAzureDbForMySqlOfflineTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.Oracle.AzureDbForPostgreSql.Sync", + value = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.class), @JsonSubTypes.Type( name = "ValidateMigrationInput.SqlServer.SqlDb.Sync", value = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class), @@ -69,12 +89,15 @@ @JsonSubTypes.Type( name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", value = ValidateMigrationInputSqlServerSqlMISyncTaskProperties.class), - @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class) + @JsonSubTypes.Type(name = "Validate.MongoDb", value = ValidateMongoDbTaskProperties.class), + @JsonSubTypes.Type( + name = "Validate.Oracle.AzureDbPostgreSql.Sync", + value = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.Ssis", value = MigrateSsisTaskProperties.class) }) -@Immutable +@Fluent public class ProjectTaskProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectTaskProperties.class); - /* * Array of errors. This is ignored if submitted. */ @@ -91,7 +114,14 @@ public class ProjectTaskProperties { * Array of command properties. */ @JsonProperty(value = "commands", access = JsonProperty.Access.WRITE_ONLY) - private List commands; + private List commands; + + /* + * Key value pairs of client data to attach meta data information to task + */ + @JsonProperty(value = "clientData") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map clientData; /** * Get the errors property: Array of errors. This is ignored if submitted. @@ -116,10 +146,30 @@ public TaskState state() { * * @return the commands value. */ - public List commands() { + public List commands() { return this.commands; } + /** + * Get the clientData property: Key value pairs of client data to attach meta data information to task. + * + * @return the clientData value. + */ + public Map clientData() { + return this.clientData; + } + + /** + * Set the clientData property: Key value pairs of client data to attach meta data information to task. + * + * @param clientData the clientData value to set. + * @return the ProjectTaskProperties object itself. + */ + public ProjectTaskProperties withClientData(Map clientData) { + this.clientData = clientData; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java index e61dd89348bb6..edf2b6ecf3f8f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java @@ -19,9 +19,9 @@ public interface Projects { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String groupName, String serviceName); + PagedIterable list(String groupName, String serviceName); /** * The project resource is a nested resource representing a stored migration project. This method returns a list of @@ -33,9 +33,9 @@ public interface Projects { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of project resources. + * @return oData page of project resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String groupName, String serviceName, Context context); + PagedIterable list(String groupName, String serviceName, Context context); /** * The project resource is a nested resource representing a stored migration project. The GET method retrieves @@ -62,7 +62,7 @@ public interface Projects { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ Response getWithResponse(String groupName, String serviceName, String projectName, Context context); @@ -91,7 +91,7 @@ public interface Projects { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, Context context); @@ -104,7 +104,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ Project getById(String id); @@ -117,7 +117,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a project resource. + * @return a project resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -142,7 +142,7 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java index 76b6650830f91..9df42c5bdc713 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java @@ -4,26 +4,22 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Results for query analysis comparison between the source and target. */ -@Immutable +@Fluent public final class QueryAnalysisValidationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryAnalysisValidationResult.class); - /* * List of queries executed and it's execution results in source and target */ - @JsonProperty(value = "queryResults", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "queryResults") private QueryExecutionResult queryResults; /* * Errors that are part of the execution */ - @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "validationErrors") private ValidationError validationErrors; /** @@ -35,6 +31,17 @@ public QueryExecutionResult queryResults() { return this.queryResults; } + /** + * Set the queryResults property: List of queries executed and it's execution results in source and target. + * + * @param queryResults the queryResults value to set. + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) { + this.queryResults = queryResults; + return this; + } + /** * Get the validationErrors property: Errors that are part of the execution. * @@ -44,6 +51,17 @@ public ValidationError validationErrors() { return this.validationErrors; } + /** + * Set the validationErrors property: Errors that are part of the execution. + * + * @param validationErrors the validationErrors value to set. + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java index 53af416f19d39..be54ec19390cb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java @@ -4,38 +4,34 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes query analysis results for execution in source and target. */ -@Immutable +@Fluent public final class QueryExecutionResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryExecutionResult.class); - /* * Query text retrieved from the source server */ - @JsonProperty(value = "queryText", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "queryText") private String queryText; /* * Total no. of statements in the batch */ - @JsonProperty(value = "statementsInBatch", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "statementsInBatch") private Long statementsInBatch; /* * Query analysis result from the source */ - @JsonProperty(value = "sourceResult", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "sourceResult") private ExecutionStatistics sourceResult; /* * Query analysis result from the target */ - @JsonProperty(value = "targetResult", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "targetResult") private ExecutionStatistics targetResult; /** @@ -47,6 +43,17 @@ public String queryText() { return this.queryText; } + /** + * Set the queryText property: Query text retrieved from the source server. + * + * @param queryText the queryText value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + /** * Get the statementsInBatch property: Total no. of statements in the batch. * @@ -56,6 +63,17 @@ public Long statementsInBatch() { return this.statementsInBatch; } + /** + * Set the statementsInBatch property: Total no. of statements in the batch. + * + * @param statementsInBatch the statementsInBatch value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withStatementsInBatch(Long statementsInBatch) { + this.statementsInBatch = statementsInBatch; + return this; + } + /** * Get the sourceResult property: Query analysis result from the source. * @@ -65,6 +83,17 @@ public ExecutionStatistics sourceResult() { return this.sourceResult; } + /** + * Set the sourceResult property: Query analysis result from the source. + * + * @param sourceResult the sourceResult value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withSourceResult(ExecutionStatistics sourceResult) { + this.sourceResult = sourceResult; + return this; + } + /** * Get the targetResult property: Query analysis result from the target. * @@ -74,6 +103,17 @@ public ExecutionStatistics targetResult() { return this.targetResult; } + /** + * Set the targetResult property: Query analysis result from the target. + * + * @param targetResult the targetResult value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withTargetResult(ExecutionStatistics targetResult) { + this.targetResult = targetResult; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java index 20110a3d3db35..9806cae934f0b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** OData page of quota objects. */ @Fluent public final class QuotaList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaList.class); - /* * List of quotas */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java index b92d1102bd084..ca94b58505429 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The name of the quota. */ @Fluent public final class QuotaName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaName.class); - /* * The localized name of the quota */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java new file mode 100644 index 0000000000000..ecce942cfda9e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** An immutable client-side representation of RegenAuthKeys. */ +public interface RegenAuthKeys { + /** + * Gets the keyName property: The name of authentication key to generate. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + String authKey1(); + + /** + * Gets the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + String authKey2(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner object. + * + * @return the inner object. + */ + RegenAuthKeysInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java new file mode 100644 index 0000000000000..673d89c6a41ed --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicateMigrationState. */ +public final class ReplicateMigrationState extends ExpandableStringEnum { + /** Static value UNDEFINED for ReplicateMigrationState. */ + public static final ReplicateMigrationState UNDEFINED = fromString("UNDEFINED"); + + /** Static value VALIDATING for ReplicateMigrationState. */ + public static final ReplicateMigrationState VALIDATING = fromString("VALIDATING"); + + /** Static value PENDING for ReplicateMigrationState. */ + public static final ReplicateMigrationState PENDING = fromString("PENDING"); + + /** Static value COMPLETE for ReplicateMigrationState. */ + public static final ReplicateMigrationState COMPLETE = fromString("COMPLETE"); + + /** Static value ACTION_REQUIRED for ReplicateMigrationState. */ + public static final ReplicateMigrationState ACTION_REQUIRED = fromString("ACTION_REQUIRED"); + + /** Static value FAILED for ReplicateMigrationState. */ + public static final ReplicateMigrationState FAILED = fromString("FAILED"); + + /** + * Creates or finds a ReplicateMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicateMigrationState. + */ + @JsonCreator + public static ReplicateMigrationState fromString(String name) { + return fromString(name, ReplicateMigrationState.class); + } + + /** @return known ReplicateMigrationState values. */ + public static Collection values() { + return values(ReplicateMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java index 4695b2016e6a8..dbd3e6b9a5700 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java @@ -5,19 +5,15 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Exception object for all custom exceptions. */ @Fluent public final class ReportableException { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportableException.class); - /* * Error message */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "message") private String message; /* @@ -29,25 +25,25 @@ public final class ReportableException { /* * The path to the file where exception occurred */ - @JsonProperty(value = "filePath", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "filePath") private String filePath; /* * The line number where exception occurred */ - @JsonProperty(value = "lineNumber", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "lineNumber") private String lineNumber; /* * Coded numerical value that is assigned to a specific exception */ - @JsonProperty(value = "hResult", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "hResult") private Integer hResult; /* * Stack trace */ - @JsonProperty(value = "stackTrace", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "stackTrace") private String stackTrace; /** @@ -59,6 +55,17 @@ public String message() { return this.message; } + /** + * Set the message property: Error message. + * + * @param message the message value to set. + * @return the ReportableException object itself. + */ + public ReportableException withMessage(String message) { + this.message = message; + return this; + } + /** * Get the actionableMessage property: Actionable steps for this exception. * @@ -88,6 +95,17 @@ public String filePath() { return this.filePath; } + /** + * Set the filePath property: The path to the file where exception occurred. + * + * @param filePath the filePath value to set. + * @return the ReportableException object itself. + */ + public ReportableException withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + /** * Get the lineNumber property: The line number where exception occurred. * @@ -97,6 +115,17 @@ public String lineNumber() { return this.lineNumber; } + /** + * Set the lineNumber property: The line number where exception occurred. + * + * @param lineNumber the lineNumber value to set. + * @return the ReportableException object itself. + */ + public ReportableException withLineNumber(String lineNumber) { + this.lineNumber = lineNumber; + return this; + } + /** * Get the hResult property: Coded numerical value that is assigned to a specific exception. * @@ -106,6 +135,17 @@ public Integer hResult() { return this.hResult; } + /** + * Set the hResult property: Coded numerical value that is assigned to a specific exception. + * + * @param hResult the hResult value to set. + * @return the ReportableException object itself. + */ + public ReportableException withHResult(Integer hResult) { + this.hResult = hResult; + return this; + } + /** * Get the stackTrace property: Stack trace. * @@ -115,6 +155,17 @@ public String stackTrace() { return this.stackTrace; } + /** + * Set the stackTrace property: Stack trace. + * + * @param stackTrace the stackTrace value to set. + * @return the ReportableException object itself. + */ + public ReportableException withStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java index f4c7dceb5684f..486af4c36e1aa 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes The SKU capabilities object. */ @Immutable public final class ResourceSkuCapabilities { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); - /* * An invariant to describe the feature. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java index 538537a2b6024..fa288fea89cef 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes scaling information of a SKU. */ @Immutable public final class ResourceSkuCapacity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapacity.class); - /* * The minimum capacity. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java index 2c90c804e6b4b..bc92802bcd4cb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes metadata for retrieving price info. */ @Immutable public final class ResourceSkuCosts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCosts.class); - /* * Used for querying price from commerce. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java index 553fca892870e..a5b1d871f7c77 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Describes scaling information of a SKU. */ @Immutable public final class ResourceSkuRestrictions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); - /* * The type of restrictions. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java index 62336798155ee..bee00c30dbb9c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java @@ -14,7 +14,7 @@ public interface ResourceSkus { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface ResourceSkus { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response. + * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java index 3fc4e6852a67b..165613872aa7b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The DMS List SKUs operation response. */ @Fluent public final class ResourceSkusResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusResult.class); - /* * The list of SKUs available for the subscription. */ @@ -78,11 +75,13 @@ public ResourceSkusResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model ResourceSkusResult")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkusResult.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java new file mode 100644 index 0000000000000..6a1c592bc722f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceType. */ +public final class ResourceType extends ExpandableStringEnum { + /** Static value SqlMi for ResourceType. */ + public static final ResourceType SQL_MI = fromString("SqlMi"); + + /** Static value SqlVm for ResourceType. */ + public static final ResourceType SQL_VM = fromString("SqlVm"); + + /** Static value SqlDb for ResourceType. */ + public static final ResourceType SQL_DB = fromString("SqlDb"); + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + @JsonCreator + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** @return known ResourceType values. */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java new file mode 100644 index 0000000000000..0772fcab14985 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScenarioSource. */ +public final class ScenarioSource extends ExpandableStringEnum { + /** Static value Access for ScenarioSource. */ + public static final ScenarioSource ACCESS = fromString("Access"); + + /** Static value DB2 for ScenarioSource. */ + public static final ScenarioSource DB2 = fromString("DB2"); + + /** Static value MySQL for ScenarioSource. */ + public static final ScenarioSource MY_SQL = fromString("MySQL"); + + /** Static value Oracle for ScenarioSource. */ + public static final ScenarioSource ORACLE = fromString("Oracle"); + + /** Static value SQL for ScenarioSource. */ + public static final ScenarioSource SQL = fromString("SQL"); + + /** Static value Sybase for ScenarioSource. */ + public static final ScenarioSource SYBASE = fromString("Sybase"); + + /** Static value PostgreSQL for ScenarioSource. */ + public static final ScenarioSource POSTGRE_SQL = fromString("PostgreSQL"); + + /** Static value MongoDB for ScenarioSource. */ + public static final ScenarioSource MONGO_DB = fromString("MongoDB"); + + /** Static value SQLRDS for ScenarioSource. */ + public static final ScenarioSource SQLRDS = fromString("SQLRDS"); + + /** Static value MySQLRDS for ScenarioSource. */ + public static final ScenarioSource MY_SQLRDS = fromString("MySQLRDS"); + + /** Static value PostgreSQLRDS for ScenarioSource. */ + public static final ScenarioSource POSTGRE_SQLRDS = fromString("PostgreSQLRDS"); + + /** + * Creates or finds a ScenarioSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioSource. + */ + @JsonCreator + public static ScenarioSource fromString(String name) { + return fromString(name, ScenarioSource.class); + } + + /** @return known ScenarioSource values. */ + public static Collection values() { + return values(ScenarioSource.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java new file mode 100644 index 0000000000000..724316427181f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScenarioTarget. */ +public final class ScenarioTarget extends ExpandableStringEnum { + /** Static value SQLServer for ScenarioTarget. */ + public static final ScenarioTarget SQLSERVER = fromString("SQLServer"); + + /** Static value SQLDB for ScenarioTarget. */ + public static final ScenarioTarget SQLDB = fromString("SQLDB"); + + /** Static value SQLDW for ScenarioTarget. */ + public static final ScenarioTarget SQLDW = fromString("SQLDW"); + + /** Static value SQLMI for ScenarioTarget. */ + public static final ScenarioTarget SQLMI = fromString("SQLMI"); + + /** Static value AzureDBForMySql for ScenarioTarget. */ + public static final ScenarioTarget AZURE_DBFOR_MY_SQL = fromString("AzureDBForMySql"); + + /** Static value AzureDBForPostgresSQL for ScenarioTarget. */ + public static final ScenarioTarget AZURE_DBFOR_POSTGRES_SQL = fromString("AzureDBForPostgresSQL"); + + /** Static value MongoDB for ScenarioTarget. */ + public static final ScenarioTarget MONGO_DB = fromString("MongoDB"); + + /** + * Creates or finds a ScenarioTarget from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioTarget. + */ + @JsonCreator + public static ScenarioTarget fromString(String name) { + return fromString(name, ScenarioTarget.class); + } + + /** @return known ScenarioTarget values. */ + public static Collection values() { + return values(ScenarioTarget.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java index 890f3405cbda9..ef35b5dbb160e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java @@ -5,38 +5,37 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Results for schema comparison between the source and target. */ @Fluent public final class SchemaComparisonValidationResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaComparisonValidationResult.class); - /* * List of schema differences between the source and target databases */ - @JsonProperty(value = "schemaDifferences", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "schemaDifferences") private SchemaComparisonValidationResultType schemaDifferences; /* * List of errors that happened while performing schema compare validation */ - @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "validationErrors") private ValidationError validationErrors; /* * Count of source database objects */ @JsonProperty(value = "sourceDatabaseObjectCount") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sourceDatabaseObjectCount; /* * Count of target database objects */ @JsonProperty(value = "targetDatabaseObjectCount") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map targetDatabaseObjectCount; /** @@ -48,6 +47,18 @@ public SchemaComparisonValidationResultType schemaDifferences() { return this.schemaDifferences; } + /** + * Set the schemaDifferences property: List of schema differences between the source and target databases. + * + * @param schemaDifferences the schemaDifferences value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSchemaDifferences( + SchemaComparisonValidationResultType schemaDifferences) { + this.schemaDifferences = schemaDifferences; + return this; + } + /** * Get the validationErrors property: List of errors that happened while performing schema compare validation. * @@ -57,6 +68,17 @@ public ValidationError validationErrors() { return this.validationErrors; } + /** + * Set the validationErrors property: List of errors that happened while performing schema compare validation. + * + * @param validationErrors the validationErrors value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + /** * Get the sourceDatabaseObjectCount property: Count of source database objects. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java index 7818a6c4adb78..67ff315d6ff57 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java @@ -4,33 +4,29 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Description about the errors happen while performing migration validation. */ -@Immutable +@Fluent public final class SchemaComparisonValidationResultType { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaComparisonValidationResultType.class); - /* * Name of the object that has the difference */ - @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "objectName") private String objectName; /* * Type of the object that has the difference. e.g * (Table/View/StoredProcedure) */ - @JsonProperty(value = "objectType", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "objectType") private ObjectType objectType; /* * Update action type with respect to target */ - @JsonProperty(value = "updateAction", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "updateAction") private UpdateActionType updateAction; /** @@ -42,6 +38,17 @@ public String objectName() { return this.objectName; } + /** + * Set the objectName property: Name of the object that has the difference. + * + * @param objectName the objectName value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + /** * Get the objectType property: Type of the object that has the difference. e.g (Table/View/StoredProcedure). * @@ -51,6 +58,17 @@ public ObjectType objectType() { return this.objectType; } + /** + * Set the objectType property: Type of the object that has the difference. e.g (Table/View/StoredProcedure). + * + * @param objectType the objectType value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + /** * Get the updateAction property: Update action type with respect to target. * @@ -60,6 +78,17 @@ public UpdateActionType updateAction() { return this.updateAction; } + /** + * Set the updateAction property: Update action type with respect to target. + * + * @param updateAction the updateAction value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withUpdateAction(UpdateActionType updateAction) { + this.updateAction = updateAction; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java new file mode 100644 index 0000000000000..e85357365538b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SchemaMigrationOption. */ +public final class SchemaMigrationOption extends ExpandableStringEnum { + /** Static value None for SchemaMigrationOption. */ + public static final SchemaMigrationOption NONE = fromString("None"); + + /** Static value ExtractFromSource for SchemaMigrationOption. */ + public static final SchemaMigrationOption EXTRACT_FROM_SOURCE = fromString("ExtractFromSource"); + + /** Static value UseStorageFile for SchemaMigrationOption. */ + public static final SchemaMigrationOption USE_STORAGE_FILE = fromString("UseStorageFile"); + + /** + * Creates or finds a SchemaMigrationOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationOption. + */ + @JsonCreator + public static SchemaMigrationOption fromString(String name) { + return fromString(name, SchemaMigrationOption.class); + } + + /** @return known SchemaMigrationOption values. */ + public static Collection values() { + return values(SchemaMigrationOption.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java new file mode 100644 index 0000000000000..a59359881c36a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for migrating schema from source to target. */ +@Fluent +public final class SchemaMigrationSetting { + /* + * Option on how to migrate the schema + */ + @JsonProperty(value = "schemaOption") + private SchemaMigrationOption schemaOption; + + /* + * Resource Identifier of a file resource containing the uploaded schema + * file + */ + @JsonProperty(value = "fileId") + private String fileId; + + /* + * Name of the file resource containing the uploaded schema file + */ + @JsonProperty(value = "fileName") + private String fileName; + + /** + * Get the schemaOption property: Option on how to migrate the schema. + * + * @return the schemaOption value. + */ + public SchemaMigrationOption schemaOption() { + return this.schemaOption; + } + + /** + * Set the schemaOption property: Option on how to migrate the schema. + * + * @param schemaOption the schemaOption value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withSchemaOption(SchemaMigrationOption schemaOption) { + this.schemaOption = schemaOption; + return this; + } + + /** + * Get the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @return the fileId value. + */ + public String fileId() { + return this.fileId; + } + + /** + * Set the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @param fileId the fileId value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileId(String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Get the fileName property: Name of the file resource containing the uploaded schema file. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: Name of the file resource containing the uploaded schema file. + * + * @param fileName the fileName value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java new file mode 100644 index 0000000000000..01ac4939d0d65 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SchemaMigrationStage. */ +public final class SchemaMigrationStage extends ExpandableStringEnum { + /** Static value NotStarted for SchemaMigrationStage. */ + public static final SchemaMigrationStage NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInputs for SchemaMigrationStage. */ + public static final SchemaMigrationStage VALIDATING_INPUTS = fromString("ValidatingInputs"); + + /** Static value CollectingObjects for SchemaMigrationStage. */ + public static final SchemaMigrationStage COLLECTING_OBJECTS = fromString("CollectingObjects"); + + /** Static value DownloadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage DOWNLOADING_SCRIPT = fromString("DownloadingScript"); + + /** Static value GeneratingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage GENERATING_SCRIPT = fromString("GeneratingScript"); + + /** Static value UploadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage UPLOADING_SCRIPT = fromString("UploadingScript"); + + /** Static value DeployingSchema for SchemaMigrationStage. */ + public static final SchemaMigrationStage DEPLOYING_SCHEMA = fromString("DeployingSchema"); + + /** Static value Completed for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value Failed for SchemaMigrationStage. */ + public static final SchemaMigrationStage FAILED = fromString("Failed"); + + /** + * Creates or finds a SchemaMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationStage. + */ + @JsonCreator + public static SchemaMigrationStage fromString(String name) { + return fromString(name, SchemaMigrationStage.class); + } + + /** @return known SchemaMigrationStage values. */ + public static Collection values() { + return values(SchemaMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java index 1347694b012db..932717b505803 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Info for certificate to be exported for TDE enabled databases. */ @Fluent public final class SelectedCertificateInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SelectedCertificateInput.class); - /* * Name of certificate to be exported. */ @@ -73,16 +70,18 @@ public SelectedCertificateInput withPassword(String password) { */ public void validate() { if (certificateName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property certificateName in model SelectedCertificateInput")); } if (password() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property password in model SelectedCertificateInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SelectedCertificateInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java index 7509c19f24bef..cce121497aa74 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java @@ -19,7 +19,10 @@ public enum ServerLevelPermissionsGroup { MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI("MigrationFromSqlServerToAzureMI"), /** Enum value MigrationFromMySQLToAzureDBForMySQL. */ - MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"); + MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"), + + /** Enum value MigrationFromSqlServerToAzureVM. */ + MIGRATION_FROM_SQL_SERVER_TO_AZURE_VM("MigrationFromSqlServerToAzureVM"); /** The actual serialized value for a ServerLevelPermissionsGroup instance. */ private final String value; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java index 5d4ad63cd8f3b..33dafe5d9c1ed 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Server properties for Oracle, MySQL type source. */ +/** Server properties for MySQL type source. */ @Immutable public final class ServerProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerProperties.class); - /* * Name of the server platform */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java deleted file mode 100644 index 12183bee471cc..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; - -/** An immutable client-side representation of ServiceOperation. */ -public interface ServiceOperation { - /** - * Gets the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Localized display text. - * - * @return the display value. - */ - ServiceOperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner object. - * - * @return the inner object. - */ - ServiceOperationInner innerModel(); -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java deleted file mode 100644 index 1124553130fc0..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Localized display text. */ -@Fluent -public final class ServiceOperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationDisplay.class); - - /* - * The localized resource provider name - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * The localized resource type name - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * The localized operation name - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * The localized operation description - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: The localized resource provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The localized resource provider name. - * - * @param provider the provider value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The localized resource type name. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The localized resource type name. - * - * @param resource the resource value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The localized operation name. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The localized operation name. - * - * @param operation the operation value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The localized operation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The localized operation description. - * - * @param description the description value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java index 74a671869892c..ad4f8488a943b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** An Azure SKU instance. */ @Fluent public final class ServiceSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSku.class); - /* * The unique name of the SKU, such as 'P3' */ @@ -21,7 +17,8 @@ public final class ServiceSku { private String name; /* - * The tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium' + * The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business + * Critical' */ @JsonProperty(value = "tier") private String tier; @@ -68,7 +65,7 @@ public ServiceSku withName(String name) { } /** - * Get the tier property: The tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * Get the tier property: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. * * @return the tier value. */ @@ -77,7 +74,7 @@ public String tier() { } /** - * Set the tier property: The tier of the SKU, such as 'Free', 'Basic', 'Standard', or 'Premium'. + * Set the tier property: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. * * @param tier the tier value to set. * @return the ServiceSku object itself. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java index 08806f0344884..248d42928bc96 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** OData page of available SKUs. */ @Fluent public final class ServiceSkuList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSkuList.class); - /* * List of service SKUs */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java new file mode 100644 index 0000000000000..1a76c8313be73 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; + +/** Resource collection API of ServiceTasks. */ +public interface ServiceTasks { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + ProjectTask createOrUpdate(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + ProjectTask get(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + ProjectTask update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + ProjectTask cancel(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response cancelWithResponse(String groupName, String serviceName, String taskName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java index f93ddb8f1dfc8..58680b1642223 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java @@ -33,7 +33,7 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response}. */ Response getByResourceGroupWithResponse( String groupName, String serviceName, Context context); @@ -100,7 +100,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return service health status. + * @return service health status along with {@link Response}. */ Response checkStatusWithResponse( String groupName, String serviceName, Context context); @@ -166,7 +166,7 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ PagedIterable listSkus(String groupName, String serviceName); @@ -180,7 +180,7 @@ Response checkStatusWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of available SKUs. + * @return oData page of available SKUs as paginated response with {@link PagedIterable}. */ PagedIterable listSkus(String groupName, String serviceName, Context context); @@ -195,7 +195,7 @@ Response checkStatusWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return indicates whether a proposed resource name is available. */ - NameAvailabilityResponse nestedCheckNameAvailability( + NameAvailabilityResponse checkChildrenNameAvailability( String groupName, String serviceName, NameAvailabilityRequest parameters); /** @@ -208,9 +208,9 @@ NameAvailabilityResponse nestedCheckNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); /** @@ -221,7 +221,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String groupName); @@ -234,7 +234,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String groupName, Context context); @@ -244,7 +244,7 @@ Response nestedCheckNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -256,7 +256,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of service objects. + * @return oData page of service objects as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -281,7 +281,7 @@ Response nestedCheckNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return indicates whether a proposed resource name is available. + * @return indicates whether a proposed resource name is available along with {@link Response}. */ Response checkNameAvailabilityWithResponse( String location, NameAvailabilityRequest parameters, Context context); @@ -294,7 +294,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response}. */ DataMigrationService getById(String id); @@ -307,7 +307,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return a Database Migration Service resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java new file mode 100644 index 0000000000000..ac9b909502b81 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Source Location details of backups. */ +@Fluent +public final class SourceLocation { + /* + * Source File share. + */ + @JsonProperty(value = "fileShare") + private SqlFileShare fileShare; + + /* + * Source Azure Blob. + */ + @JsonProperty(value = "azureBlob") + private AzureBlob azureBlob; + + /* + * Backup storage Type. + */ + @JsonProperty(value = "fileStorageType", access = JsonProperty.Access.WRITE_ONLY) + private String fileStorageType; + + /** + * Get the fileShare property: Source File share. + * + * @return the fileShare value. + */ + public SqlFileShare fileShare() { + return this.fileShare; + } + + /** + * Set the fileShare property: Source File share. + * + * @param fileShare the fileShare value to set. + * @return the SourceLocation object itself. + */ + public SourceLocation withFileShare(SqlFileShare fileShare) { + this.fileShare = fileShare; + return this; + } + + /** + * Get the azureBlob property: Source Azure Blob. + * + * @return the azureBlob value. + */ + public AzureBlob azureBlob() { + return this.azureBlob; + } + + /** + * Set the azureBlob property: Source Azure Blob. + * + * @param azureBlob the azureBlob value to set. + * @return the SourceLocation object itself. + */ + public SourceLocation withAzureBlob(AzureBlob azureBlob) { + this.azureBlob = azureBlob; + return this; + } + + /** + * Get the fileStorageType property: Backup storage Type. + * + * @return the fileStorageType value. + */ + public String fileStorageType() { + return this.fileStorageType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileShare() != null) { + fileShare().validate(); + } + if (azureBlob() != null) { + azureBlob().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java new file mode 100644 index 0000000000000..03a889dc97bda --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information of backup file. */ +@Immutable +public final class SqlBackupFileInfo { + /* + * File name. + */ + @JsonProperty(value = "fileName", access = JsonProperty.Access.WRITE_ONLY) + private String fileName; + + /* + * Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored + * or Skipped) + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * File size in bytes + */ + @JsonProperty(value = "totalSize", access = JsonProperty.Access.WRITE_ONLY) + private Long totalSize; + + /* + * Bytes read + */ + @JsonProperty(value = "dataRead", access = JsonProperty.Access.WRITE_ONLY) + private Long dataRead; + + /* + * Bytes written + */ + @JsonProperty(value = "dataWritten", access = JsonProperty.Access.WRITE_ONLY) + private Long dataWritten; + + /* + * Copy throughput in KBps + */ + @JsonProperty(value = "copyThroughput", access = JsonProperty.Access.WRITE_ONLY) + private Double copyThroughput; + + /* + * Copy Duration in seconds + */ + @JsonProperty(value = "copyDuration", access = JsonProperty.Access.WRITE_ONLY) + private Integer copyDuration; + + /* + * Media family sequence number + */ + @JsonProperty(value = "familySequenceNumber", access = JsonProperty.Access.WRITE_ONLY) + private Integer familySequenceNumber; + + /** + * Get the fileName property: File name. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Get the status property: Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped). + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the totalSize property: File size in bytes. + * + * @return the totalSize value. + */ + public Long totalSize() { + return this.totalSize; + } + + /** + * Get the dataRead property: Bytes read. + * + * @return the dataRead value. + */ + public Long dataRead() { + return this.dataRead; + } + + /** + * Get the dataWritten property: Bytes written. + * + * @return the dataWritten value. + */ + public Long dataWritten() { + return this.dataWritten; + } + + /** + * Get the copyThroughput property: Copy throughput in KBps. + * + * @return the copyThroughput value. + */ + public Double copyThroughput() { + return this.copyThroughput; + } + + /** + * Get the copyDuration property: Copy Duration in seconds. + * + * @return the copyDuration value. + */ + public Integer copyDuration() { + return this.copyDuration; + } + + /** + * Get the familySequenceNumber property: Media family sequence number. + * + * @return the familySequenceNumber value. + */ + public Integer familySequenceNumber() { + return this.familySequenceNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java new file mode 100644 index 0000000000000..c3d41c4469999 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** Information of backup set. */ +@Immutable +public final class SqlBackupSetInfo { + /* + * Backup set id. + */ + @JsonProperty(value = "backupSetId", access = JsonProperty.Access.WRITE_ONLY) + private UUID backupSetId; + + /* + * First LSN of the backup set. + */ + @JsonProperty(value = "firstLSN", access = JsonProperty.Access.WRITE_ONLY) + private String firstLsn; + + /* + * Last LSN of the backup set. + */ + @JsonProperty(value = "lastLSN", access = JsonProperty.Access.WRITE_ONLY) + private String lastLsn; + + /* + * Backup type. + */ + @JsonProperty(value = "backupType", access = JsonProperty.Access.WRITE_ONLY) + private String backupType; + + /* + * List of files in the backup set. + */ + @JsonProperty(value = "listOfBackupFiles", access = JsonProperty.Access.WRITE_ONLY) + private List listOfBackupFiles; + + /* + * Backup start date. + */ + @JsonProperty(value = "backupStartDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime backupStartDate; + + /* + * Backup end time. + */ + @JsonProperty(value = "backupFinishDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime backupFinishDate; + + /* + * Whether this backup set has been restored or not. + */ + @JsonProperty(value = "isBackupRestored", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isBackupRestored; + + /* + * Has Backup Checksums + */ + @JsonProperty(value = "hasBackupChecksums", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasBackupChecksums; + + /* + * Media family count + */ + @JsonProperty(value = "familyCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer familyCount; + + /* + * The reasons why the backup set is ignored + */ + @JsonProperty(value = "ignoreReasons", access = JsonProperty.Access.WRITE_ONLY) + private List ignoreReasons; + + /** + * Get the backupSetId property: Backup set id. + * + * @return the backupSetId value. + */ + public UUID backupSetId() { + return this.backupSetId; + } + + /** + * Get the firstLsn property: First LSN of the backup set. + * + * @return the firstLsn value. + */ + public String firstLsn() { + return this.firstLsn; + } + + /** + * Get the lastLsn property: Last LSN of the backup set. + * + * @return the lastLsn value. + */ + public String lastLsn() { + return this.lastLsn; + } + + /** + * Get the backupType property: Backup type. + * + * @return the backupType value. + */ + public String backupType() { + return this.backupType; + } + + /** + * Get the listOfBackupFiles property: List of files in the backup set. + * + * @return the listOfBackupFiles value. + */ + public List listOfBackupFiles() { + return this.listOfBackupFiles; + } + + /** + * Get the backupStartDate property: Backup start date. + * + * @return the backupStartDate value. + */ + public OffsetDateTime backupStartDate() { + return this.backupStartDate; + } + + /** + * Get the backupFinishDate property: Backup end time. + * + * @return the backupFinishDate value. + */ + public OffsetDateTime backupFinishDate() { + return this.backupFinishDate; + } + + /** + * Get the isBackupRestored property: Whether this backup set has been restored or not. + * + * @return the isBackupRestored value. + */ + public Boolean isBackupRestored() { + return this.isBackupRestored; + } + + /** + * Get the hasBackupChecksums property: Has Backup Checksums. + * + * @return the hasBackupChecksums value. + */ + public Boolean hasBackupChecksums() { + return this.hasBackupChecksums; + } + + /** + * Get the familyCount property: Media family count. + * + * @return the familyCount value. + */ + public Integer familyCount() { + return this.familyCount; + } + + /** + * Get the ignoreReasons property: The reasons why the backup set is ignored. + * + * @return the ignoreReasons value. + */ + public List ignoreReasons() { + return this.ignoreReasons; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listOfBackupFiles() != null) { + listOfBackupFiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java index 99fa52e29e196..3819bf84dece0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +15,6 @@ @JsonTypeName("SqlConnectionInfo") @Fluent public final class SqlConnectionInfo extends ConnectionInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlConnectionInfo.class); - /* * Data source in the format * Protocol:MachineName\SQLServerInstanceName,PortNumber @@ -25,6 +22,37 @@ public final class SqlConnectionInfo extends ConnectionInfo { @JsonProperty(value = "dataSource", required = true) private String dataSource; + /* + * name of the server + */ + @JsonProperty(value = "serverName") + private String serverName; + + /* + * Port for Server + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * server version + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /* + * server brand version + */ + @JsonProperty(value = "serverBrandVersion") + private String serverBrandVersion; + + /* + * Represents the ID of an HTTP resource represented by an Azure resource + * provider. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + /* * Authentication type to use for connection */ @@ -75,6 +103,106 @@ public SqlConnectionInfo withDataSource(String dataSource) { return this; } + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the port property: Port for Server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port for Server. + * + * @param port the port value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider. + * + * @param resourceId the resourceId value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + /** * Get the authentication property: Authentication type to use for connection. * @@ -198,9 +326,11 @@ public SqlConnectionInfo withPassword(String password) { public void validate() { super.validate(); if (dataSource() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property dataSource in model SqlConnectionInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SqlConnectionInfo.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java new file mode 100644 index 0000000000000..c097a0803a373 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Source SQL Connection. */ +@Fluent +public final class SqlConnectionInformation { + /* + * Data source. + */ + @JsonProperty(value = "dataSource") + private String dataSource; + + /* + * Authentication type. + */ + @JsonProperty(value = "authentication") + private String authentication; + + /* + * User name to connect to source SQL. + */ + @JsonProperty(value = "userName") + private String username; + + /* + * Password to connect to source SQL. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Whether to encrypt connection or not. + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * Whether to trust server certificate or not. + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the authentication property: Authentication type. + * + * @return the authentication value. + */ + public String authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type. + * + * @param authentication the authentication value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withAuthentication(String authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the username property: User name to connect to source SQL. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name to connect to source SQL. + * + * @param username the username value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password to connect to source SQL. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password to connect to source SQL. + * + * @param password the password value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt connection or not. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt connection or not. + * + * @param encryptConnection the encryptConnection value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust server certificate or not. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust server certificate or not. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java new file mode 100644 index 0000000000000..700b571265089 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Detailed status of current Sql Db migration. */ +@Immutable +public final class SqlDbMigrationStatusDetails { + /* + * Current State of Migration. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private String migrationState; + + /* + * Sql Data Copy errors, if any. + */ + @JsonProperty(value = "sqlDataCopyErrors", access = JsonProperty.Access.WRITE_ONLY) + private List sqlDataCopyErrors; + + /* + * Details on progress of ADF copy activities. + */ + @JsonProperty(value = "listOfCopyProgressDetails", access = JsonProperty.Access.WRITE_ONLY) + private List listOfCopyProgressDetails; + + /** + * Get the migrationState property: Current State of Migration. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.migrationState; + } + + /** + * Get the sqlDataCopyErrors property: Sql Data Copy errors, if any. + * + * @return the sqlDataCopyErrors value. + */ + public List sqlDataCopyErrors() { + return this.sqlDataCopyErrors; + } + + /** + * Get the listOfCopyProgressDetails property: Details on progress of ADF copy activities. + * + * @return the listOfCopyProgressDetails value. + */ + public List listOfCopyProgressDetails() { + return this.listOfCopyProgressDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listOfCopyProgressDetails() != null) { + listOfCopyProgressDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java new file mode 100644 index 0000000000000..36a30aeaae013 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Offline configuration. */ +@Immutable +public final class SqlDbOfflineConfiguration { + /* + * Offline migration + */ + @JsonProperty(value = "offline", access = JsonProperty.Access.WRITE_ONLY) + private Boolean offline; + + /** + * Get the offline property: Offline migration. + * + * @return the offline value. + */ + public Boolean offline() { + return this.offline; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java new file mode 100644 index 0000000000000..414f7d66abc02 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** File share. */ +@Fluent +public final class SqlFileShare { + /* + * Location as SMB share or local drive where backups are placed. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Username to access the file share location for backups. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password for username to access file share location. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the path property: Location as SMB share or local drive where backups are placed. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Location as SMB share or local drive where backups are placed. + * + * @param path the path value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the username property: Username to access the file share location for backups. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username to access the file share location for backups. + * + * @param username the username value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password for username to access file share location. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for username to access file share location. + * + * @param password the password value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java new file mode 100644 index 0000000000000..eedcd0d2bdc3d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of SQL Migration Service. */ +@Immutable +public final class SqlMigrationListResult { + /* + * The value property. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java new file mode 100644 index 0000000000000..7e3a5ba6d93f0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import java.util.Map; + +/** An immutable client-side representation of SqlMigrationService. */ +public interface SqlMigrationService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + String integrationRuntimeState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner object. + * + * @return the inner object. + */ + SqlMigrationServiceInner innerModel(); + + /** The entirety of the SqlMigrationService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SqlMigrationService definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlMigrationService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SqlMigrationService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SqlMigrationService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SqlMigrationService definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlMigrationService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlMigrationService create(Context context); + } + /** The stage of the SqlMigrationService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the SqlMigrationService resource. + * + * @return the stage of resource update. + */ + SqlMigrationService.Update update(); + + /** The template for SqlMigrationService update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlMigrationService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlMigrationService apply(Context context); + } + /** The SqlMigrationService update stages. */ + interface UpdateStages { + /** The stage of the SqlMigrationService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlMigrationService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlMigrationService refresh(Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + AuthenticationKeys listAuthKeys(); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + Response listAuthKeysWithResponse(Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + RegenAuthKeys regenerateAuthKeys(RegenAuthKeysInner parameters); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + Response regenerateAuthKeysWithResponse(RegenAuthKeysInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + DeleteNode deleteNode(DeleteNodeInner parameters); + + /** + * Delete the integration runtime node. + * + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + Response deleteNodeWithResponse(DeleteNodeInner parameters, Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + IntegrationRuntimeMonitoringData listMonitoringData(); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + Response listMonitoringDataWithResponse(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java new file mode 100644 index 0000000000000..89212275d3927 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An update to a SQL Migration Service. */ +@Fluent +public final class SqlMigrationServiceUpdate { + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the SqlMigrationServiceUpdate object itself. + */ + public SqlMigrationServiceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java new file mode 100644 index 0000000000000..088354f492884 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** Resource collection API of SqlMigrationServices. */ +public interface SqlMigrationServices { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + SqlMigrationService getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + AuthenticationKeys listAuthKeys(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + Response listAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + RegenAuthKeys regenerateAuthKeys( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + Response regenerateAuthKeysWithResponse( + String resourceGroupName, String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + DeleteNode deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + Response deleteNodeWithResponse( + String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters, Context context); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + IntegrationRuntimeMonitoringData listMonitoringData(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + Response listMonitoringDataWithResponse( + String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + SqlMigrationService getById(String id); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlMigrationService resource. + * + * @param name resource name. + * @return the first stage of the new SqlMigrationService definition. + */ + SqlMigrationService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java index 7769b111dc873..372793e96c748 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Base class for migration task input. */ @Fluent public class SqlMigrationTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationTaskInput.class); - /* * Information for connecting to source */ @@ -73,7 +70,7 @@ public SqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetCo */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model SqlMigrationTaskInput")); @@ -81,7 +78,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model SqlMigrationTaskInput")); @@ -89,4 +86,6 @@ public void validate() { targetConnectionInfo().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(SqlMigrationTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java index c1d7ff665251c..ecce40e9cd829 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ @Fluent public class SqlServerSqlMISyncTaskInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerSqlMISyncTaskInput.class); - /* * Databases to migrate */ @@ -183,7 +180,7 @@ public SqlServerSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp azureApp */ public void validate() { if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model SqlServerSqlMISyncTaskInput")); @@ -194,13 +191,13 @@ public void validate() { backupFileShare().validate(); } if (storageResourceId() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property storageResourceId in model SqlServerSqlMISyncTaskInput")); } if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model SqlServerSqlMISyncTaskInput")); @@ -208,7 +205,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model SqlServerSqlMISyncTaskInput")); @@ -216,7 +213,7 @@ public void validate() { targetConnectionInfo().validate(); } if (azureApp() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property azureApp in model SqlServerSqlMISyncTaskInput")); @@ -224,4 +221,6 @@ public void validate() { azureApp().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(SqlServerSqlMISyncTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java new file mode 100644 index 0000000000000..519d70b6ccadf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSIS migration info with SSIS store type, overwrite policy. */ +@Fluent +public final class SsisMigrationInfo { + /* + * The SSIS store type of source, only SSIS catalog is supported now in DMS + */ + @JsonProperty(value = "ssisStoreType") + private SsisStoreType ssisStoreType; + + /* + * The overwrite option for the SSIS project migration + */ + @JsonProperty(value = "projectOverwriteOption") + private SsisMigrationOverwriteOption projectOverwriteOption; + + /* + * The overwrite option for the SSIS environment migration + */ + @JsonProperty(value = "environmentOverwriteOption") + private SsisMigrationOverwriteOption environmentOverwriteOption; + + /** + * Get the ssisStoreType property: The SSIS store type of source, only SSIS catalog is supported now in DMS. + * + * @return the ssisStoreType value. + */ + public SsisStoreType ssisStoreType() { + return this.ssisStoreType; + } + + /** + * Set the ssisStoreType property: The SSIS store type of source, only SSIS catalog is supported now in DMS. + * + * @param ssisStoreType the ssisStoreType value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withSsisStoreType(SsisStoreType ssisStoreType) { + this.ssisStoreType = ssisStoreType; + return this; + } + + /** + * Get the projectOverwriteOption property: The overwrite option for the SSIS project migration. + * + * @return the projectOverwriteOption value. + */ + public SsisMigrationOverwriteOption projectOverwriteOption() { + return this.projectOverwriteOption; + } + + /** + * Set the projectOverwriteOption property: The overwrite option for the SSIS project migration. + * + * @param projectOverwriteOption the projectOverwriteOption value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withProjectOverwriteOption(SsisMigrationOverwriteOption projectOverwriteOption) { + this.projectOverwriteOption = projectOverwriteOption; + return this; + } + + /** + * Get the environmentOverwriteOption property: The overwrite option for the SSIS environment migration. + * + * @return the environmentOverwriteOption value. + */ + public SsisMigrationOverwriteOption environmentOverwriteOption() { + return this.environmentOverwriteOption; + } + + /** + * Set the environmentOverwriteOption property: The overwrite option for the SSIS environment migration. + * + * @param environmentOverwriteOption the environmentOverwriteOption value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withEnvironmentOverwriteOption(SsisMigrationOverwriteOption environmentOverwriteOption) { + this.environmentOverwriteOption = environmentOverwriteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java new file mode 100644 index 0000000000000..1d96e820200dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisMigrationOverwriteOption. */ +public final class SsisMigrationOverwriteOption extends ExpandableStringEnum { + /** Static value Ignore for SsisMigrationOverwriteOption. */ + public static final SsisMigrationOverwriteOption IGNORE = fromString("Ignore"); + + /** Static value Overwrite for SsisMigrationOverwriteOption. */ + public static final SsisMigrationOverwriteOption OVERWRITE = fromString("Overwrite"); + + /** + * Creates or finds a SsisMigrationOverwriteOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationOverwriteOption. + */ + @JsonCreator + public static SsisMigrationOverwriteOption fromString(String name) { + return fromString(name, SsisMigrationOverwriteOption.class); + } + + /** @return known SsisMigrationOverwriteOption values. */ + public static Collection values() { + return values(SsisMigrationOverwriteOption.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java new file mode 100644 index 0000000000000..d11e703fab6da --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisMigrationStage. */ +public final class SsisMigrationStage extends ExpandableStringEnum { + /** Static value None for SsisMigrationStage. */ + public static final SsisMigrationStage NONE = fromString("None"); + + /** Static value Initialize for SsisMigrationStage. */ + public static final SsisMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value InProgress for SsisMigrationStage. */ + public static final SsisMigrationStage IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for SsisMigrationStage. */ + public static final SsisMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a SsisMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationStage. + */ + @JsonCreator + public static SsisMigrationStage fromString(String name) { + return fromString(name, SsisMigrationStage.class); + } + + /** @return known SsisMigrationStage values. */ + public static Collection values() { + return values(SsisMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java new file mode 100644 index 0000000000000..e68f7978f9457 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisStoreType. */ +public final class SsisStoreType extends ExpandableStringEnum { + /** Static value SsisCatalog for SsisStoreType. */ + public static final SsisStoreType SSIS_CATALOG = fromString("SsisCatalog"); + + /** + * Creates or finds a SsisStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisStoreType. + */ + @JsonCreator + public static SsisStoreType fromString(String name) { + return fromString(name, SsisStoreType.class); + } + + /** @return known SsisStoreType values. */ + public static Collection values() { + return values(SsisStoreType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java index 7294cc9a00933..3c123af0bd592 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java @@ -44,6 +44,27 @@ public final class SyncDatabaseMigrationReportingState /** Static value FAILED for SyncDatabaseMigrationReportingState. */ public static final SyncDatabaseMigrationReportingState FAILED = fromString("FAILED"); + /** Static value VALIDATING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATING = fromString("VALIDATING"); + + /** Static value VALIDATION_COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATION_COMPLETE = fromString("VALIDATION_COMPLETE"); + + /** Static value VALIDATION_FAILED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATION_FAILED = fromString("VALIDATION_FAILED"); + + /** Static value RESTORE_IN_PROGRESS for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RESTORE_IN_PROGRESS = fromString("RESTORE_IN_PROGRESS"); + + /** Static value RESTORE_COMPLETED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RESTORE_COMPLETED = fromString("RESTORE_COMPLETED"); + + /** Static value BACKUP_IN_PROGRESS for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState BACKUP_IN_PROGRESS = fromString("BACKUP_IN_PROGRESS"); + + /** Static value BACKUP_COMPLETED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState BACKUP_COMPLETED = fromString("BACKUP_COMPLETED"); + /** * Creates or finds a SyncDatabaseMigrationReportingState from its string representation. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java index 5949daccac34e..c89cc6e2ba057 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Database migration errors for online migration. */ @Immutable public final class SyncMigrationDatabaseErrorEvent { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncMigrationDatabaseErrorEvent.class); - /* * String value of timestamp. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java new file mode 100644 index 0000000000000..4471ce11ad3e0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Target Location details for optional copy of backups. */ +@Fluent +public final class TargetLocation { + /* + * Resource Id of the storage account copying backups. + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Storage Account Key. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /** + * Get the storageAccountResourceId property: Resource Id of the storage account copying backups. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Resource Id of the storage account copying backups. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the TargetLocation object itself. + */ + public TargetLocation withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the accountKey property: Storage Account Key. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage Account Key. + * + * @param accountKey the accountKey value to set. + * @return the TargetLocation object itself. + */ + public TargetLocation withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java index fca4f3ae24d22..82a65f5a51ec6 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** OData page of tasks. */ @Fluent public final class TaskList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskList.class); - /* * List of tasks */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java new file mode 100644 index 0000000000000..87ff0819b97d8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TaskType. */ +public final class TaskType extends ExpandableStringEnum { + /** Static value Connect.MongoDb for TaskType. */ + public static final TaskType CONNECT_MONGO_DB = fromString("Connect.MongoDb"); + + /** Static value ConnectToSource.SqlServer for TaskType. */ + public static final TaskType CONNECT_TO_SOURCE_SQL_SERVER = fromString("ConnectToSource.SqlServer"); + + /** Static value ConnectToSource.SqlServer.Sync for TaskType. */ + public static final TaskType CONNECT_TO_SOURCE_SQL_SERVER_SYNC = fromString("ConnectToSource.SqlServer.Sync"); + + /** Static value ConnectToSource.PostgreSql.Sync for TaskType. */ + public static final TaskType CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC = fromString("ConnectToSource.PostgreSql.Sync"); + + /** Static value ConnectToSource.MySql for TaskType. */ + public static final TaskType CONNECT_TO_SOURCE_MY_SQL = fromString("ConnectToSource.MySql"); + + /** Static value ConnectToSource.Oracle.Sync for TaskType. */ + public static final TaskType CONNECT_TO_SOURCE_ORACLE_SYNC = fromString("ConnectToSource.Oracle.Sync"); + + /** Static value ConnectToTarget.SqlDb for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_SQL_DB = fromString("ConnectToTarget.SqlDb"); + + /** Static value ConnectToTarget.SqlDb.Sync for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_SQL_DB_SYNC = fromString("ConnectToTarget.SqlDb.Sync"); + + /** Static value ConnectToTarget.AzureDbForPostgreSql.Sync for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC = + fromString("ConnectToTarget.AzureDbForPostgreSql.Sync"); + + /** Static value ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC = + fromString("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync"); + + /** Static value ConnectToTarget.AzureSqlDbMI for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_AZURE_SQL_DB_MI = fromString("ConnectToTarget.AzureSqlDbMI"); + + /** Static value ConnectToTarget.AzureSqlDbMI.Sync.LRS for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS = + fromString("ConnectToTarget.AzureSqlDbMI.Sync.LRS"); + + /** Static value ConnectToTarget.AzureDbForMySql for TaskType. */ + public static final TaskType CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL = fromString("ConnectToTarget.AzureDbForMySql"); + + /** Static value GetUserTables.Sql for TaskType. */ + public static final TaskType GET_USER_TABLES_SQL = fromString("GetUserTables.Sql"); + + /** Static value GetUserTables.AzureSqlDb.Sync for TaskType. */ + public static final TaskType GET_USER_TABLES_AZURE_SQL_DB_SYNC = fromString("GetUserTables.AzureSqlDb.Sync"); + + /** Static value GetUserTablesOracle for TaskType. */ + public static final TaskType GET_USER_TABLES_ORACLE = fromString("GetUserTablesOracle"); + + /** Static value GetUserTablesPostgreSql for TaskType. */ + public static final TaskType GET_USER_TABLES_POSTGRE_SQL = fromString("GetUserTablesPostgreSql"); + + /** Static value GetUserTablesMySql for TaskType. */ + public static final TaskType GET_USER_TABLES_MY_SQL = fromString("GetUserTablesMySql"); + + /** Static value Migrate.MongoDb for TaskType. */ + public static final TaskType MIGRATE_MONGO_DB = fromString("Migrate.MongoDb"); + + /** Static value Migrate.SqlServer.AzureSqlDbMI for TaskType. */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI = fromString("Migrate.SqlServer.AzureSqlDbMI"); + + /** Static value Migrate.SqlServer.AzureSqlDbMI.Sync.LRS for TaskType. */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS = + fromString("Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"); + + /** Static value Migrate.SqlServer.SqlDb for TaskType. */ + public static final TaskType MIGRATE_SQL_SERVER_SQL_DB = fromString("Migrate.SqlServer.SqlDb"); + + /** Static value Migrate.SqlServer.AzureSqlDb.Sync for TaskType. */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC = fromString("Migrate.SqlServer.AzureSqlDb.Sync"); + + /** Static value Migrate.MySql.AzureDbForMySql.Sync for TaskType. */ + public static final TaskType MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC = + fromString("Migrate.MySql.AzureDbForMySql.Sync"); + + /** Static value Migrate.MySql.AzureDbForMySql for TaskType. */ + public static final TaskType MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL = fromString("Migrate.MySql.AzureDbForMySql"); + + /** Static value Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2 for TaskType. */ + public static final TaskType MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2 = + fromString("Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2"); + + /** Static value Migrate.Oracle.AzureDbForPostgreSql.Sync for TaskType. */ + public static final TaskType MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC = + fromString("Migrate.Oracle.AzureDbForPostgreSql.Sync"); + + /** Static value ValidateMigrationInput.SqlServer.SqlDb.Sync for TaskType. */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC = + fromString("ValidateMigrationInput.SqlServer.SqlDb.Sync"); + + /** Static value ValidateMigrationInput.SqlServer.AzureSqlDbMI for TaskType. */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI = + fromString("ValidateMigrationInput.SqlServer.AzureSqlDbMI"); + + /** Static value ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS for TaskType. */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS = + fromString("ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"); + + /** Static value Validate.MongoDb for TaskType. */ + public static final TaskType VALIDATE_MONGO_DB = fromString("Validate.MongoDb"); + + /** Static value Validate.Oracle.AzureDbPostgreSql.Sync for TaskType. */ + public static final TaskType VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC = + fromString("Validate.Oracle.AzureDbPostgreSql.Sync"); + + /** Static value GetTDECertificates.Sql for TaskType. */ + public static final TaskType GET_TDECERTIFICATES_SQL = fromString("GetTDECertificates.Sql"); + + /** Static value Migrate.Ssis for TaskType. */ + public static final TaskType MIGRATE_SSIS = fromString("Migrate.Ssis"); + + /** Static value Service.Check.OCI for TaskType. */ + public static final TaskType SERVICE_CHECK_OCI = fromString("Service.Check.OCI"); + + /** Static value Service.Upload.OCI for TaskType. */ + public static final TaskType SERVICE_UPLOAD_OCI = fromString("Service.Upload.OCI"); + + /** Static value Service.Install.OCI for TaskType. */ + public static final TaskType SERVICE_INSTALL_OCI = fromString("Service.Install.OCI"); + + /** Static value MigrateSchemaSqlServerSqlDb for TaskType. */ + public static final TaskType MIGRATE_SCHEMA_SQL_SERVER_SQL_DB = fromString("MigrateSchemaSqlServerSqlDb"); + + /** + * Creates or finds a TaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskType. + */ + @JsonCreator + public static TaskType fromString(String name) { + return fromString(name, TaskType.class); + } + + /** @return known TaskType values. */ + public static Collection values() { + return values(TaskType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java index 9559990f1e376..daf6e649b1e48 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; /** Resource collection API of Tasks. */ public interface Tasks { @@ -21,7 +22,7 @@ public interface Tasks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ PagedIterable list(String groupName, String serviceName, String projectName); @@ -38,7 +39,7 @@ public interface Tasks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of tasks. + * @return oData page of tasks as paginated response with {@link PagedIterable}. */ PagedIterable list( String groupName, String serviceName, String projectName, String taskType, Context context); @@ -71,7 +72,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ Response getWithResponse( String groupName, String serviceName, String projectName, String taskName, String expand, Context context); @@ -103,7 +104,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String groupName, @@ -140,11 +141,51 @@ Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ Response cancelWithResponse( String groupName, String serviceName, String projectName, String taskName, Context context); + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + CommandProperties command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties along with {@link Response}. + */ + Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context); + /** * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method * retrieves information about a task. @@ -153,7 +194,7 @@ Response cancelWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ ProjectTask getById(String id); @@ -167,7 +208,7 @@ Response cancelWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a task resource. + * @return a task resource along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); @@ -192,7 +233,7 @@ Response cancelWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java new file mode 100644 index 0000000000000..1ef126cef3340 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to upload an OCI driver. */ +@Fluent +public final class UploadOciDriverTaskInput { + /* + * File share information for the OCI driver archive. + */ + @JsonProperty(value = "driverShare") + private FileShare driverShare; + + /** + * Get the driverShare property: File share information for the OCI driver archive. + * + * @return the driverShare value. + */ + public FileShare driverShare() { + return this.driverShare; + } + + /** + * Set the driverShare property: File share information for the OCI driver archive. + * + * @param driverShare the driverShare value to set. + * @return the UploadOciDriverTaskInput object itself. + */ + public UploadOciDriverTaskInput withDriverShare(FileShare driverShare) { + this.driverShare = driverShare; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (driverShare() != null) { + driverShare().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java new file mode 100644 index 0000000000000..22d6b477da96f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for the service task to upload an OCI driver. */ +@Immutable +public final class UploadOciDriverTaskOutput { + /* + * The name of the driver package that was validated and uploaded. + */ + @JsonProperty(value = "driverPackageName", access = JsonProperty.Access.WRITE_ONLY) + private String driverPackageName; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the driverPackageName property: The name of the driver package that was validated and uploaded. + * + * @return the driverPackageName value. + */ + public String driverPackageName() { + return this.driverPackageName; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java new file mode 100644 index 0000000000000..282b4a39bf025 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that uploads an OCI driver. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Upload.OCI") +@Fluent +public final class UploadOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Input for the service task to upload an OCI driver. + */ + @JsonProperty(value = "input") + private UploadOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to upload an OCI driver. + * + * @return the input value. + */ + public UploadOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to upload an OCI driver. + * + * @param input the input value to set. + * @return the UploadOciDriverTaskProperties object itself. + */ + public UploadOciDriverTaskProperties withInput(UploadOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public UploadOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java index 05413591ed3a3..2e3bd2ee189dc 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java @@ -16,7 +16,7 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ PagedIterable list(String location); @@ -28,7 +28,7 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of quota objects. + * @return oData page of quota objects as paginated response with {@link PagedIterable}. */ PagedIterable list(String location, Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java index 8368a23dcf700..df51a7d188eae 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for task that validates migration input for SQL to Azure SQL DB sync migrations. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ValidateMigrationInput.SqlServer.SqlDb.Sync") @Fluent public final class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class); - /* * Task input */ @@ -62,6 +58,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java index 18d22ee0a6763..14e3cbc5baad8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java @@ -4,17 +4,12 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import java.util.List; /** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ -@Immutable +@Fluent public final class ValidateMigrationInputSqlServerSqlMISyncTaskInput extends SqlServerSqlMISyncTaskInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskInput.class); - /** {@inheritDoc} */ @Override public ValidateMigrationInputSqlServerSqlMISyncTaskInput withSelectedDatabases( diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java index 9c85e39e1c017..25a3ed1aca458 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for task that validates migration input for Azure SQL Database Managed Instance online migration. */ @Immutable public final class ValidateMigrationInputSqlServerSqlMISyncTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskOutput.class); - /* * Database identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java index af61493513713..0a7237d0540f6 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") @Fluent public final class ValidateMigrationInputSqlServerSqlMISyncTaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskProperties.class); - /* * Task input */ @@ -62,6 +58,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java index 230a476a32876..a31905147f7a2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for task that validates migration input for SQL to Azure SQL Managed Instance. */ @Fluent public final class ValidateMigrationInputSqlServerSqlMITaskInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskInput.class); - /* * Information for connecting to source */ @@ -210,7 +206,7 @@ public ValidateMigrationInputSqlServerSqlMITaskInput withBackupMode(BackupMode b */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -219,7 +215,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -228,7 +224,7 @@ public void validate() { targetConnectionInfo().validate(); } if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model" @@ -240,7 +236,7 @@ public void validate() { backupFileShare().validate(); } if (backupBlobShare() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property backupBlobShare in model" @@ -249,4 +245,6 @@ public void validate() { backupBlobShare().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java index 94dbac24d2af2..5a552c71810ac 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations. */ @Fluent public final class ValidateMigrationInputSqlServerSqlMITaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskOutput.class); - /* * Result identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java index 279ddf01f5f3f..1c1356244ecdc 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; +import java.util.Map; /** Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") @JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI") @Fluent public final class ValidateMigrationInputSqlServerSqlMITaskProperties extends ProjectTaskProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskProperties.class); - /* * Task input */ @@ -62,6 +58,13 @@ public List output() { return this.output; } + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java new file mode 100644 index 0000000000000..f12b1ac3781c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates a migration between MongoDB data sources. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Validate.MongoDb") +@Fluent +public final class ValidateMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Describes how a MongoDB data migration should be performed + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /* + * An array containing a single MongoDbMigrationProgress object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes how a MongoDB data migration should be performed. + * + * @return the input value. + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input property: Describes how a MongoDB data migration should be performed. + * + * @param input the input value to set. + * @return the ValidateMongoDbTaskProperties object itself. + */ + public ValidateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single MongoDbMigrationProgress object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 0000000000000..3bdf9e7aecf84 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Validate.Oracle.AzureDbPostgreSql.Sync") +@Fluent +public final class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Input for the task that migrates Oracle databases to Azure Database for + * PostgreSQL for online migrations + */ + @JsonProperty(value = "input") + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * An array containing a single validation error response object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for + * online migrations. + * + * @return the input value. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for + * online migrations. + * + * @param input the input value to set. + * @return the ValidateOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + MigrateOracleAzureDbPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single validation error response object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java new file mode 100644 index 0000000000000..128833a417c91 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations. */ +@Immutable +public final class ValidateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Errors associated with a selected database object + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the validationErrors property: Errors associated with a selected database object. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java index c8036c3547d47..73d597f793b48 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Input for task that validates migration input for SQL sync migrations. */ @Fluent public final class ValidateSyncMigrationInputSqlServerTaskInput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateSyncMigrationInputSqlServerTaskInput.class); - /* * Information for connecting to source SQL server */ @@ -104,7 +100,7 @@ public ValidateSyncMigrationInputSqlServerTaskInput withSelectedDatabases( */ public void validate() { if (sourceConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property sourceConnectionInfo in model" @@ -113,7 +109,7 @@ public void validate() { sourceConnectionInfo().validate(); } if (targetConnectionInfo() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property targetConnectionInfo in model" @@ -122,7 +118,7 @@ public void validate() { targetConnectionInfo().validate(); } if (selectedDatabases() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property selectedDatabases in model" @@ -131,4 +127,6 @@ public void validate() { selectedDatabases().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(ValidateSyncMigrationInputSqlServerTaskInput.class); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java index e563383146807..3c4eee20bd664 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Output for task that validates migration input for SQL sync migrations. */ @Immutable public final class ValidateSyncMigrationInputSqlServerTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ValidateSyncMigrationInputSqlServerTaskOutput.class); - /* * Database identifier */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java index cd719a8a55de3..14699942a5a32 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java @@ -4,26 +4,22 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Description about the errors happen while performing migration validation. */ -@Immutable +@Fluent public final class ValidationError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationError.class); - /* * Error Text */ - @JsonProperty(value = "text", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "text") private String text; /* * Severity of the error */ - @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "severity") private Severity severity; /** @@ -35,6 +31,17 @@ public String text() { return this.text; } + /** + * Set the text property: Error Text. + * + * @param text the text value to set. + * @return the ValidationError object itself. + */ + public ValidationError withText(String text) { + this.text = text; + return this; + } + /** * Get the severity property: Severity of the error. * @@ -44,6 +51,17 @@ public Severity severity() { return this.severity; } + /** + * Set the severity property: Severity of the error. + * + * @param severity the severity value to set. + * @return the ValidationError object itself. + */ + public ValidationError withSeverity(Severity severity) { + this.severity = severity; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java index 3a5bc7f9d151e..164cca7a46543 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java @@ -28,12 +28,12 @@ public final class ValidationStatus extends ExpandableStringEnum Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java new file mode 100644 index 0000000000000..417d8b1d2d545 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; + +/** Samples for Tasks Cancel. */ +public final class TasksCancelSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java new file mode 100644 index 0000000000000..3b95acca83724 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; + +/** Samples for Tasks Command. */ +public final class TasksCommandSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Command.json + */ + /** + * Sample code: Tasks_Command. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCommand(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .commandWithResponse( + "DmsSdkRg", + "DmsSdkService", + "DmsSdkProject", + "DmsSdkTask", + new MigrateSyncCompleteCommandProperties() + .withInput(new MigrateSyncCompleteCommandInput().withDatabaseName("TestDatabase")), + Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ee9735e0dcdf9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.AuthenticationType; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; + +/** Samples for Tasks CreateOrUpdate. */ +public final class TasksCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_CreateOrUpdate.json + */ + /** + * Sample code: Tasks_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .define("DmsSdkTask") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties( + new ConnectToTargetSqlDbTaskProperties() + .withInput( + new ConnectToTargetSqlDbTaskInput() + .withTargetConnectionInfo( + new SqlConnectionInfo() + .withUsername("testuser") + .withPassword("testpassword") + .withDataSource("ssma-test-server.database.windows.net") + .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) + .withEncryptConnection(true) + .withTrustServerCertificate(true)))) + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java new file mode 100644 index 0000000000000..349138b195eab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; + +/** Samples for Tasks Delete. */ +public final class TasksDeleteSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager + .tasks() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java new file mode 100644 index 0000000000000..8f844c629c5a1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; + +/** Samples for Tasks Get. */ +public final class TasksGetSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java new file mode 100644 index 0000000000000..450e8588c4856 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; + +/** Samples for Tasks List. */ +public final class TasksListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_List.json + */ + /** + * Sample code: Tasks_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java new file mode 100644 index 0000000000000..d9900c55fc98c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.models.AuthenticationType; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; + +/** Samples for Tasks Update. */ +public final class TasksUpdateSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Tasks_Update.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + ProjectTask resource = + manager + .tasks() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new ConnectToTargetSqlDbTaskProperties() + .withInput( + new ConnectToTargetSqlDbTaskInput() + .withTargetConnectionInfo( + new SqlConnectionInfo() + .withUsername("testuser") + .withPassword("testpassword") + .withDataSource("ssma-test-server.database.windows.net") + .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) + .withEncryptConnection(true) + .withTrustServerCertificate(true)))) + .apply(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java new file mode 100644 index 0000000000000..3e338a8153cf2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.core.util.Context; + +/** Samples for Usages List. */ +public final class UsagesListSamples { + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-03-30-preview/examples/Usages_List.json + */ + /** + * Sample code: Services_Usages. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesUsages(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.usages().list("westus", Context.NONE); + } +}