From c4ee85223c1731bec2812c0d23becd576696f815 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sun, 27 Feb 2022 22:37:50 +0000 Subject: [PATCH] CodeGen from PR 17190 in Azure/azure-rest-api-specs Merge 806cc305cdadb345ff583e3052b4b670c6ff9171 into bb4175d29020cfff55f1d9087c2a5a89765067dc --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 1787 +++++++++++ .../pom.xml | 98 +- .../datamigration/DataMigrationManager.java | 111 +- .../fluent/DataMigrationManagementClient.java | 43 +- .../DatabaseMigrationsSqlMisClient.java | 295 ++ .../DatabaseMigrationsSqlVmsClient.java | 307 ++ .../datamigration/fluent/FilesClient.java | 256 ++ .../fluent/OperationsClient.java | 14 +- .../datamigration/fluent/ProjectsClient.java | 16 +- .../fluent/ResourceSkusClient.java | 4 +- .../fluent/ServiceTasksClient.java | 216 ++ .../datamigration/fluent/ServicesClient.java | 64 +- .../fluent/SqlMigrationServicesClient.java | 454 +++ .../datamigration/fluent/TasksClient.java | 57 +- .../datamigration/fluent/UsagesClient.java | 4 +- .../models/AuthenticationKeysInner.java | 76 + .../models/AvailableServiceSkuInner.java | 8 +- .../fluent/models/CommandPropertiesInner.java | 83 + .../models/DataMigrationServiceInner.java | 155 +- .../DataMigrationServiceProperties.java | 178 ++ ...taMigrationServiceStatusResponseInner.java | 26 + .../fluent/models/DatabaseMigrationInner.java | 71 + .../models/DatabaseMigrationSqlMiInner.java | 71 + .../models/DatabaseMigrationSqlVmInner.java | 71 + .../fluent/models/DeleteNodeInner.java | 76 + .../fluent/models/FileStorageInfoInner.java | 79 + ...IntegrationRuntimeMonitoringDataInner.java | 59 + .../models/NameAvailabilityResponseInner.java | 43 +- .../models/OperationsDefinitionInner.java | 118 + .../fluent/models/ProjectFileInner.java | 97 + .../fluent/models/ProjectInner.java | 172 +- .../fluent/models/ProjectProperties.java | 245 ++ .../fluent/models/ProjectTaskInner.java | 16 + .../fluent/models/RegenAuthKeysInner.java | 102 + .../fluent/models/ServiceOperationInner.java | 81 - .../models/SqlMigrationServiceInner.java | 92 + .../models/SqlMigrationServiceProperties.java | 54 + ...nImpl.java => AuthenticationKeysImpl.java} | 23 +- .../AvailableServiceSkuImpl.java | 4 +- .../implementation/CommandPropertiesImpl.java | 46 + .../DataMigrationManagementClientBuilder.java | 4 +- .../DataMigrationManagementClientImpl.java | 92 +- .../DataMigrationServiceImpl.java | 40 +- ...ataMigrationServiceStatusResponseImpl.java | 4 + .../implementation/DatabaseMigrationImpl.java | 51 + .../DatabaseMigrationSqlMiImpl.java | 183 ++ .../DatabaseMigrationSqlVmImpl.java | 185 ++ .../DatabaseMigrationsSqlMisClientImpl.java | 1335 ++++++++ .../DatabaseMigrationsSqlMisImpl.java | 178 ++ .../DatabaseMigrationsSqlVmsClientImpl.java | 1369 +++++++++ .../DatabaseMigrationsSqlVmsImpl.java | 184 ++ .../implementation/DeleteNodeImpl.java | 36 + .../implementation/FileStorageInfoImpl.java | 43 + .../implementation/FilesClientImpl.java | 1562 ++++++++++ .../implementation/FilesImpl.java | 267 ++ .../IntegrationRuntimeMonitoringDataImpl.java | 45 + .../implementation/OperationsClientImpl.java | 60 +- .../OperationsDefinitionImpl.java | 58 + .../implementation/OperationsImpl.java | 16 +- .../implementation/ProjectFileImpl.java | 173 ++ .../implementation/ProjectImpl.java | 24 + .../implementation/ProjectTaskImpl.java | 17 + .../implementation/ProjectsClientImpl.java | 94 +- .../implementation/ProjectsImpl.java | 10 +- .../implementation/RegenAuthKeysImpl.java | 40 + .../ResourceSkusClientImpl.java | 20 +- .../ServiceTasksClientImpl.java | 1387 +++++++++ .../implementation/ServiceTasksImpl.java | 154 + .../implementation/ServicesClientImpl.java | 253 +- .../implementation/ServicesImpl.java | 8 +- .../SqlMigrationServiceImpl.java | 234 ++ .../SqlMigrationServicesClientImpl.java | 2681 +++++++++++++++++ .../SqlMigrationServicesImpl.java | 312 ++ .../implementation/TasksClientImpl.java | 290 +- .../implementation/TasksImpl.java | 39 +- .../implementation/UsagesClientImpl.java | 16 +- .../models/AuthenticationKeys.java | 31 + .../models/AvailableServiceSku.java | 2 +- ...rated.java => AvailableServiceSkuSku.java} | 27 +- .../models/AzureActiveDirectoryApp.java | 26 + .../datamigration/models/AzureBlob.java | 102 + .../models/BackupConfiguration.java | 82 + .../datamigration/models/BlobShare.java | 7 +- .../models/CheckOciDriverTaskInput.java | 50 + .../models/CheckOciDriverTaskOutput.java | 72 + .../models/CheckOciDriverTaskProperties.java | 86 + .../models/CommandProperties.java | 61 +- .../datamigration/models/CommandType.java | 44 + .../ConnectToMongoDbTaskProperties.java | 86 + .../models/ConnectToSourceMySqlTaskInput.java | 26 + .../ConnectToSourceMySqlTaskProperties.java | 8 + .../ConnectToSourceNonSqlTaskOutput.java | 2 +- .../ConnectToSourceOracleSyncTaskInput.java | 58 + .../ConnectToSourceOracleSyncTaskOutput.java | 88 + ...nnectToSourceOracleSyncTaskProperties.java | 86 + ...tToSourcePostgreSqlSyncTaskProperties.java | 8 + ...ctToSourceSqlServerSyncTaskProperties.java | 8 + .../ConnectToSourceSqlServerTaskInput.java | 107 + ...ourceSqlServerTaskOutputAgentJobLevel.java | 41 +- ...tToSourceSqlServerTaskOutputTaskLevel.java | 16 + ...onnectToSourceSqlServerTaskProperties.java | 34 + ...nnectToTargetAzureDbForMySqlTaskInput.java | 26 + ...ToTargetAzureDbForMySqlTaskProperties.java | 8 + ...zureDbForPostgreSqlSyncTaskProperties.java | 8 + ...acleAzureDbForPostgreSqlSyncTaskInput.java | 64 + ...cleAzureDbForPostgreSqlSyncTaskOutput.java | 122 + ...qlSyncTaskOutputDatabaseSchemaMapItem.java | 80 + ...zureDbForPostgreSqlSyncTaskProperties.java | 92 + ...onnectToTargetSqlDbSyncTaskProperties.java | 8 + .../models/ConnectToTargetSqlDbTaskInput.java | 29 + .../ConnectToTargetSqlDbTaskProperties.java | 34 + ...onnectToTargetSqlMISyncTaskProperties.java | 8 + .../models/ConnectToTargetSqlMITaskInput.java | 81 + .../ConnectToTargetSqlMITaskProperties.java | 8 + .../datamigration/models/ConnectionInfo.java | 2 + .../models/DataIntegrityValidationResult.java | 32 +- .../models/DataMigrationResultCode.java | 47 - .../models/DataMigrationService.java | 115 +- .../DataMigrationServiceStatusResponse.java | 7 + .../models/DatabaseFileInput.java | 154 - .../models/DatabaseMigration.java | 53 + .../models/DatabaseMigrationListResult.java | 59 + .../models/DatabaseMigrationProperties.java | 251 ++ .../DatabaseMigrationPropertiesSqlMi.java | 193 ++ .../DatabaseMigrationPropertiesSqlVm.java | 193 ++ .../models/DatabaseMigrationSqlMi.java | 200 ++ .../models/DatabaseMigrationSqlVm.java | 200 ++ .../models/DatabaseMigrationsSqlMis.java | 157 + .../models/DatabaseMigrationsSqlVms.java | 163 + .../datamigration/models/DatabaseTable.java | 54 + .../datamigration/models/DeleteNode.java | 31 + ...DataMigrationError.java => ErrorInfo.java} | 49 +- .../datamigration/models/ErrorType.java | 37 - .../models/ExecutionStatistics.java | 67 +- ...erviceOperationList.java => FileList.java} | 32 +- .../datamigration/models/FileStorageInfo.java | 32 + .../datamigration/models/Files.java | 217 ++ .../GetTdeCertificatesSqlTaskProperties.java | 8 + .../models/GetUserTablesMySqlTaskInput.java | 91 + .../models/GetUserTablesMySqlTaskOutput.java | 73 + .../GetUserTablesMySqlTaskProperties.java | 86 + .../models/GetUserTablesOracleTaskInput.java | 91 + .../models/GetUserTablesOracleTaskOutput.java | 76 + .../GetUserTablesOracleTaskProperties.java | 86 + .../GetUserTablesPostgreSqlTaskInput.java | 91 + .../GetUserTablesPostgreSqlTaskOutput.java | 76 + ...GetUserTablesPostgreSqlTaskProperties.java | 86 + .../GetUserTablesSqlSyncTaskProperties.java | 8 + .../models/GetUserTablesSqlTaskInput.java | 26 + .../GetUserTablesSqlTaskProperties.java | 34 + .../models/InstallOciDriverTaskInput.java | 50 + .../models/InstallOciDriverTaskOutput.java | 43 + .../InstallOciDriverTaskProperties.java | 86 + .../IntegrationRuntimeMonitoringData.java | 33 + ...igrateMISyncCompleteCommandProperties.java | 3 +- .../models/MigrateMongoDbTaskProperties.java | 86 + ...qlAzureDbForMySqlOfflineDatabaseInput.java | 109 + ...eMySqlAzureDbForMySqlOfflineTaskInput.java | 246 ++ ...MySqlAzureDbForMySqlOfflineTaskOutput.java | 59 + ...orMySqlOfflineTaskOutputDatabaseLevel.java | 264 ++ ...AzureDbForMySqlOfflineTaskOutputError.java | 50 + ...rMySqlOfflineTaskOutputMigrationLevel.java | 292 ++ ...DbForMySqlOfflineTaskOutputTableLevel.java | 184 ++ ...lAzureDbForMySqlOfflineTaskProperties.java | 140 + ...MySqlAzureDbForMySqlSyncDatabaseInput.java | 31 + ...ySqlAzureDbForMySqlSyncTaskProperties.java | 8 + ...zureDbForPostgreSqlSyncTaskProperties.java | 88 + ...cleAzureDbPostgreSqlSyncDatabaseInput.java | 242 ++ ...eOracleAzureDbPostgreSqlSyncTaskInput.java | 133 + ...OracleAzureDbPostgreSqlSyncTaskOutput.java | 62 + ...PostgreSqlSyncTaskOutputDatabaseError.java | 90 + ...PostgreSqlSyncTaskOutputDatabaseLevel.java | 259 ++ ...eAzureDbPostgreSqlSyncTaskOutputError.java | 50 + ...ostgreSqlSyncTaskOutputMigrationLevel.java | 124 + ...eDbPostgreSqlSyncTaskOutputTableLevel.java | 228 ++ ...AzureDbForPostgreSqlSyncDatabaseInput.java | 56 +- ...DbForPostgreSqlSyncDatabaseTableInput.java | 52 + ...eSqlAzureDbForPostgreSqlSyncTaskInput.java | 43 + ...ureDbForPostgreSqlSyncTaskOutputError.java | 35 +- ...ostgreSqlSyncTaskOutputMigrationLevel.java | 75 +- ...zureDbForPostgreSqlSyncTaskProperties.java | 88 +- ...rateSchemaSqlServerSqlDbDatabaseInput.java | 131 + .../MigrateSchemaSqlServerSqlDbTaskInput.java | 128 + ...MigrateSchemaSqlServerSqlDbTaskOutput.java | 56 + ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 182 ++ ...teSchemaSqlServerSqlDbTaskOutputError.java | 60 + ...qlServerSqlDbTaskOutputMigrationLevel.java | 137 + ...ateSchemaSqlServerSqlDbTaskProperties.java | 164 + .../MigrateSchemaSqlTaskOutputError.java | 48 + .../MigrateSqlServerSqlDbDatabaseInput.java | 54 + ...igrateSqlServerSqlDbSyncDatabaseInput.java | 5 + ...grateSqlServerSqlDbSyncTaskProperties.java | 8 + .../MigrateSqlServerSqlDbTaskInput.java | 52 + ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 2 +- ...skOutputDatabaseLevelValidationResult.java | 17 +- .../MigrateSqlServerSqlDbTaskOutputError.java | 2 +- ...qlServerSqlDbTaskOutputMigrationLevel.java | 67 +- ...ateSqlServerSqlDbTaskOutputTableLevel.java | 2 +- ...ServerSqlDbTaskOutputValidationResult.java | 19 +- .../MigrateSqlServerSqlDbTaskProperties.java | 86 + .../MigrateSqlServerSqlMIDatabaseInput.java | 26 + .../MigrateSqlServerSqlMISyncTaskInput.java | 32 +- ...grateSqlServerSqlMISyncTaskProperties.java | 34 + .../MigrateSqlServerSqlMITaskInput.java | 82 + .../MigrateSqlServerSqlMITaskProperties.java | 112 + .../models/MigrateSsisTaskInput.java | 74 + .../models/MigrateSsisTaskOutput.java | 52 + .../MigrateSsisTaskOutputMigrationLevel.java | 185 ++ .../MigrateSsisTaskOutputProjectLevel.java | 155 + .../models/MigrateSsisTaskProperties.java | 86 + .../MigrateSyncCompleteCommandProperties.java | 29 +- .../models/MigrationOperationInput.java | 51 + .../models/MigrationReportResult.java | 30 +- .../models/MigrationStatusDetails.java | 229 ++ .../models/MigrationTableMetadata.java | 54 - ...igrationValidationDatabaseLevelResult.java | 188 ++ .../models/MigrationValidationResult.java | 111 + .../models/MongoDbCancelCommand.java | 60 + .../models/MongoDbClusterInfo.java | 149 + .../models/MongoDbClusterType.java | 37 + .../models/MongoDbCollectionInfo.java | 259 ++ .../models/MongoDbCollectionProgress.java | 122 + .../models/MongoDbCollectionSettings.java | 111 + .../models/MongoDbCommandInput.java | 53 + .../models/MongoDbConnectionInfo.java | 288 ++ .../models/MongoDbDatabaseInfo.java | 124 + .../models/MongoDbDatabaseProgress.java | 164 + .../models/MongoDbDatabaseSettings.java | 101 + .../datamigration/models/MongoDbError.java | 130 + .../models/MongoDbErrorType.java | 37 + .../models/MongoDbFinishCommand.java | 60 + .../models/MongoDbFinishCommandInput.java | 63 + .../models/MongoDbMigrationProgress.java | 164 + .../models/MongoDbMigrationSettings.java | 229 ++ .../models/MongoDbMigrationState.java | 61 + .../models/MongoDbObjectInfo.java | 168 ++ .../datamigration/models/MongoDbProgress.java | 428 +++ .../models/MongoDbProgressResultType.java | 37 + .../models/MongoDbReplication.java | 37 + .../models/MongoDbRestartCommand.java | 60 + .../models/MongoDbShardKeyField.java | 86 + .../models/MongoDbShardKeyInfo.java | 84 + .../models/MongoDbShardKeyOrder.java | 37 + .../models/MongoDbShardKeySetting.java | 84 + .../models/MongoDbThrottlingSettings.java | 106 + .../models/MySqlConnectionInfo.java | 78 + .../models/NodeMonitoringData.java | 163 + .../models/NonSqlDataMigrationTable.java | 50 - .../models/OfflineConfiguration.java | 83 + .../models/OperationListResult.java | 59 + .../datamigration/models/OperationOrigin.java | 34 + .../datamigration/models/Operations.java | 12 +- .../models/OperationsDefinition.java | 53 + .../models/OperationsDisplayDefinition.java | 84 + .../models/OracleConnectionInfo.java | 75 + .../models/OracleOciDriverInfo.java | 117 + .../models/PostgreSqlConnectionInfo.java | 182 ++ .../datamigration/models/Project.java | 71 + .../datamigration/models/ProjectFile.java | 226 ++ .../models/ProjectFileProperties.java | 140 + .../models/ProjectSourcePlatform.java | 9 + .../models/ProjectTargetPlatform.java | 12 + .../datamigration/models/ProjectTask.java | 36 +- .../models/ProjectTaskProperties.java | 68 +- .../datamigration/models/Projects.java | 18 +- .../models/QueryAnalysisValidationResult.java | 30 +- .../models/QueryExecutionResult.java | 56 +- .../datamigration/models/RegenAuthKeys.java | 38 + .../models/ReplicateMigrationState.java | 46 + .../models/ReportableException.java | 65 +- .../datamigration/models/ResourceSkus.java | 4 +- .../datamigration/models/ResourceType.java | 34 + .../datamigration/models/ScenarioSource.java | 61 + .../datamigration/models/ScenarioTarget.java | 49 + .../SchemaComparisonValidationResult.java | 30 +- .../SchemaComparisonValidationResultType.java | 43 +- .../models/SchemaMigrationOption.java | 37 + .../models/SchemaMigrationSetting.java | 103 + .../models/SchemaMigrationStage.java | 58 + .../models/ServerLevelPermissionsGroup.java | 5 +- .../models/ServerProperties.java | 2 +- .../models/ServiceOperation.java | 31 - .../models/ServiceOperationDisplay.java | 128 - .../datamigration/models/ServiceSku.java | 7 +- .../datamigration/models/ServiceTasks.java | 201 ++ .../datamigration/models/Services.java | 28 +- .../datamigration/models/SourceLocation.java | 82 + .../models/SqlBackupFileInfo.java | 145 + .../models/SqlBackupSetInfo.java | 195 ++ .../models/SqlConnectionInfo.java | 131 + .../models/SqlConnectionInformation.java | 180 ++ .../datamigration/models/SqlFileShare.java | 102 + .../models/SqlMigrationListResult.java | 59 + .../models/SqlMigrationService.java | 306 ++ .../models/SqlMigrationServiceUpdate.java | 53 + .../models/SqlMigrationServices.java | 311 ++ .../models/SsisMigrationInfo.java | 102 + .../models/SsisMigrationOverwriteOption.java | 34 + .../models/SsisMigrationStage.java | 40 + .../datamigration/models/SsisStoreType.java | 31 + .../SyncDatabaseMigrationReportingState.java | 21 + .../datamigration/models/TargetLocation.java | 76 + .../datamigration/models/TaskType.java | 153 + .../datamigration/models/Tasks.java | 57 +- .../models/UploadOciDriverTaskInput.java | 53 + .../models/UploadOciDriverTaskOutput.java | 58 + .../models/UploadOciDriverTaskProperties.java | 86 + .../datamigration/models/Usages.java | 4 +- ...InputSqlServerSqlDbSyncTaskProperties.java | 8 + ...ationInputSqlServerSqlMISyncTaskInput.java | 4 +- ...InputSqlServerSqlMISyncTaskProperties.java | 8 + ...tionInputSqlServerSqlMITaskProperties.java | 8 + .../models/ValidateMongoDbTaskProperties.java | 86 + ...zureDbForPostgreSqlSyncTaskProperties.java | 93 + ...OracleAzureDbPostgreSqlSyncTaskOutput.java | 44 + .../datamigration/models/ValidationError.java | 30 +- .../models/ValidationStatus.java | 6 +- .../datamigration/models/WaitStatistics.java | 43 +- .../DatabaseMigrationsSqlMiCancelSamples.java | 33 + ...eMigrationsSqlMiCreateOrUpdateSamples.java | 110 + ...DatabaseMigrationsSqlMiCutoverSamples.java | 33 + .../DatabaseMigrationsSqlMiGetSamples.java | 40 + .../DatabaseMigrationsSqlVmCancelSamples.java | 33 + ...eMigrationsSqlVmCreateOrUpdateSamples.java | 110 + ...DatabaseMigrationsSqlVmCutoverSamples.java | 33 + .../DatabaseMigrationsSqlVmGetSamples.java | 36 + .../generated/FilesCreateOrUpdateSamples.java | 27 + .../generated/FilesDeleteSamples.java | 22 + .../generated/FilesGetSamples.java | 22 + .../generated/FilesListSamples.java | 22 + .../generated/FilesReadSamples.java | 22 + .../generated/FilesReadWriteSamples.java | 22 + .../generated/FilesUpdateSamples.java | 32 + .../generated/OperationsListSamples.java | 23 + .../ProjectsCreateOrUpdateSamples.java | 30 + .../generated/ProjectsDeleteSamples.java | 22 + .../generated/ProjectsGetSamples.java | 22 + .../generated/ProjectsListSamples.java | 22 + .../generated/ProjectsUpdateSamples.java | 31 + .../generated/ResourceSkusListSamples.java | 22 + .../generated/ServiceTasksCancelSamples.java | 22 + .../ServiceTasksCreateOrUpdateSamples.java | 35 + .../generated/ServiceTasksDeleteSamples.java | 22 + .../generated/ServiceTasksGetSamples.java | 22 + .../generated/ServiceTasksListSamples.java | 22 + .../generated/ServiceTasksUpdateSamples.java | 35 + ...sCheckChildrenNameAvailabilitySamples.java | 30 + .../ServicesCheckNameAvailabilitySamples.java | 27 + .../generated/ServicesCheckStatusSamples.java | 22 + .../ServicesCreateOrUpdateSamples.java | 30 + .../generated/ServicesDeleteSamples.java | 22 + .../ServicesGetByResourceGroupSamples.java | 22 + .../ServicesListByResourceGroupSamples.java | 23 + .../generated/ServicesListSamples.java | 22 + .../generated/ServicesListSkusSamples.java | 22 + .../generated/ServicesStartSamples.java | 22 + .../generated/ServicesStopSamples.java | 22 + .../generated/ServicesUpdateSamples.java | 29 + ...igrationServicesCreateOrUpdateSamples.java | 44 + ...SqlMigrationServicesDeleteNodeSamples.java | 30 + .../SqlMigrationServicesDeleteSamples.java | 22 + ...tionServicesGetByResourceGroupSamples.java | 22 + ...lMigrationServicesListAuthKeysSamples.java | 23 + ...ionServicesListByResourceGroupSamples.java | 23 + ...igrationServicesListMigrationsSamples.java | 23 + ...tionServicesListMonitoringDataSamples.java | 22 + .../SqlMigrationServicesListSamples.java | 23 + ...tionServicesRegenerateAuthKeysSamples.java | 27 + .../SqlMigrationServicesUpdateSamples.java | 41 + .../generated/TasksCancelSamples.java | 22 + .../generated/TasksCommandSamples.java | 33 + .../generated/TasksCreateOrUpdateSamples.java | 41 + .../generated/TasksDeleteSamples.java | 24 + .../generated/TasksGetSamples.java | 22 + .../generated/TasksListSamples.java | 22 + .../generated/TasksUpdateSamples.java | 46 + .../generated/UsagesListSamples.java | 22 + 379 files changed, 37164 insertions(+), 1370 deletions(-) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/{ServiceOperationImpl.java => AuthenticationKeysImpl.java} (52%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/{AvailableServiceSkuAutoGenerated.java => AvailableServiceSkuSku.java} (70%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/{DataMigrationError.java => ErrorInfo.java} (55%) delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/{ServiceOperationList.java => FileList.java} (61%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCutoverSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCutoverSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadWriteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/OperationsListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ResourceSkusListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckChildrenNameAvailabilitySamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilitySamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesGetByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStartSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStopSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteNodeSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesGetByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListAuthKeysSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMigrationsSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMonitoringDataSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesRegenerateAuthKeysSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md index d518ea66cb153..885f288c4aa43 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-02-27) +- 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-01. 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..7fd810e523ed0 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-01. 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..9df2aaa3d8bc2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md @@ -0,0 +1,1787 @@ +# Code snippets and samples + + +## 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) +### 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-01-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-01-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-01-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"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .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-01-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-01-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, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-01-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-01-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-01-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-01-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"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .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-01-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-01-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, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2022-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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-01-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 3d14efb45d538..a3e71eb887fd6 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-01. + 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.25.0 - - - com.azure - azure-core-management - 1.5.2 - - + + 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.25.0 + + + com.azure + azure-core-management + 1.5.2 + + 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..49684f55bf102 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,8 +8,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,21 +17,32 @@ import com.azure.core.http.policy.RequestIdPolicy; 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.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.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 +50,31 @@ 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 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; @@ -97,6 +119,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -136,6 +159,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. * @@ -192,20 +226,33 @@ 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); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); 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 +264,40 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil } } + /** @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 +322,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 +346,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..a399a5acb4d2e 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,34 @@ public interface DataMigrationManagementClient { */ Duration getDefaultPollInterval(); + /** + * 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 +93,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 +115,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/DatabaseMigrationsSqlMisClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java new file mode 100644 index 0000000000000..2d6eaa8226d3e --- /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 The child resources to include 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..acbc638b2a2f3 --- /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 The child resources to include 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..48e1b9ce12f9c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java @@ -0,0 +1,76 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An authentication key. */ +@Fluent +public final class AuthenticationKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthenticationKeysInner.class); + + /* + * 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..e2b1deab04619 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 @@ -6,8 +6,8 @@ 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.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,7 +26,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 +59,7 @@ public AvailableServiceSkuInner withResourceType(String resourceType) { * * @return the sku value. */ - public AvailableServiceSkuAutoGenerated sku() { + public AvailableServiceSkuSku sku() { return this.sku; } @@ -69,7 +69,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..75d1f7e49b939 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommandPropertiesInner.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; + + /** + * 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..9997e9f923f2c 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,8 +5,8 @@ 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.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; import com.azure.resourcemanager.datamigration.models.ServiceSku; @@ -15,9 +15,8 @@ import java.util.Map; /** A Database Migration Service resource. */ -@JsonFlatten @Fluent -public class DataMigrationServiceInner extends Resource { +public final class DataMigrationServiceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceInner.class); /* @@ -33,30 +32,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 +89,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 +118,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 +156,7 @@ public ServiceProvisioningState provisioningState() { * @return the publicKey value. */ public String publicKey() { - return this.publicKey; + return this.innerProperties() == null ? null : this.innerProperties().publicKey(); } /** @@ -143,7 +166,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 +180,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 +191,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 +275,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..c6d3b8f641de2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Database Migration Service instance. */ +@Fluent +public final class DataMigrationServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceProperties.class); + + /* + * 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..78357b8747503 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 @@ -21,6 +21,12 @@ public final class DataMigrationServiceStatusResponseInner { @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 +67,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..4372818ddc779 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java @@ -0,0 +1,71 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource. */ +@Fluent +public final class DatabaseMigrationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationInner.class); + + /* + * 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/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..0e4e34c639813 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java @@ -0,0 +1,71 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource for SQL Managed Instance. */ +@Fluent +public final class DatabaseMigrationSqlMiInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationSqlMiInner.class); + + /* + * 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..25045b528c9b0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java @@ -0,0 +1,71 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Database Migration Resource for SQL Virtual Machine. */ +@Fluent +public final class DatabaseMigrationSqlVmInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationSqlVmInner.class); + + /* + * 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..a9d4f65825850 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java @@ -0,0 +1,76 @@ +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of node to be deleted. */ +@Fluent +public final class DeleteNodeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeleteNodeInner.class); + + /* + * 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..56a0ab4d3d8f8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.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.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; + +/** File storage information. */ +@Fluent +public final class FileStorageInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileStorageInfoInner.class); + + /* + * 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..ee18c2e6e4b3b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.NodeMonitoringData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Integration Runtime Monitoring Data. */ +@Immutable +public final class IntegrationRuntimeMonitoringDataInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeMonitoringDataInner.class); + + /* + * 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..360029265a87f 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,14 +4,14 @@ package com.azure.resourcemanager.datamigration.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; 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); @@ -19,20 +19,20 @@ public final class NameAvailabilityResponseInner { * 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 +44,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 +64,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 +84,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..23a5ab1cb74cc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.OperationOrigin; +import com.azure.resourcemanager.datamigration.models.OperationsDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The OperationsDefinition model. */ +@Fluent +public final class OperationsDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDefinitionInner.class); + + /* + * 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..d5da3649860fa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java @@ -0,0 +1,97 @@ +// 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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A file resource. */ +@Fluent +public final class ProjectFileInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectFileInner.class); + + /* + * 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..41ae62247b4ec 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,9 +5,10 @@ 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.management.SystemData; 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; @@ -20,52 +21,79 @@ import java.util.Map; /** A project resource. */ -@JsonFlatten @Fluent -public class ProjectInner extends Resource { +public final class ProjectInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectInner.class); /* - * 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 +101,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 +111,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 +149,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 +159,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 +172,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 +181,7 @@ public OffsetDateTime creationTime() { * @return the sourceConnectionInfo value. */ public ConnectionInfo sourceConnectionInfo() { - return this.sourceConnectionInfo; + return this.innerProperties() == null ? null : this.innerProperties().sourceConnectionInfo(); } /** @@ -132,7 +191,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 +204,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 +214,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 +227,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 +237,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 +250,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 +259,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..e00f29521131d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Project-specific properties. */ +@Fluent +public final class ProjectProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectProperties.class); + + /* + * 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()); + } + } +} 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..29bcd475835b9 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,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,6 +29,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 +75,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/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..7b43e7de3933b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.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.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; + +/** An authentication key to regenerate. */ +@Fluent +public final class RegenAuthKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenAuthKeysInner.class); + + /* + * 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/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..5769ed57cd78d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java @@ -0,0 +1,92 @@ +// 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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A SQL Migration Service. */ +@Fluent +public final class SqlMigrationServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationServiceInner.class); + + /* + * 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..3fbc1a5d60afa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.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.fluent.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; + +/** The SQL Migration Service properties. */ +@Immutable +public final class SqlMigrationServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationServiceProperties.class); + + /* + * 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..474e55fbdbb1e 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 @@ -19,12 +19,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. 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..e06424dfd0616 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,15 @@ 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.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; @@ -43,11 +48,11 @@ 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 +120,54 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** 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 +204,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 +240,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 +259,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 +274,18 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-04-19"; + this.apiVersion = "2022-01-30-preview"; + 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); } /** 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/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/DatabaseMigrationsSqlMisClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java new file mode 100644 index 0000000000000..9a665bebb5dac --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java @@ -0,0 +1,1335 @@ +// 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(DatabaseMigrationsSqlMisClientImpl.class); + + /** 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 The child resources to include 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 The child resources to include 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 The child resources to include 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 The child resources to include 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..04502b3ec01cd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.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.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 com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.UUID; + +public final class DatabaseMigrationsSqlMisImpl implements DatabaseMigrationsSqlMis { + @JsonIgnore private 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..88e704342ef81 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java @@ -0,0 +1,1369 @@ +// 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(DatabaseMigrationsSqlVmsClientImpl.class); + + /** 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 The child resources to include 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 The child resources to include 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 The child resources to include 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 The child resources to include 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..184e5d3e962ba --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.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.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 com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.UUID; + +public final class DatabaseMigrationsSqlVmsImpl implements DatabaseMigrationsSqlVms { + @JsonIgnore private 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..9d22ce80fad4d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java @@ -0,0 +1,1562 @@ +// 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.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.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 { + private final ClientLogger logger = new ClientLogger(FilesClientImpl.class); + + /** 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..3c6556e458bed --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java @@ -0,0 +1,267 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FilesImpl implements Files { + @JsonIgnore private 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..c1b502ec8042f 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 @@ -27,8 +27,8 @@ 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. */ @@ -63,7 +63,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 +73,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 +81,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 +100,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 +113,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 +146,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 +205,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 +222,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 +242,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..59c6d98675121 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,9 +8,9 @@ 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.azure.resourcemanager.datamigration.models.OperationsDefinition; import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { @@ -26,14 +26,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..7f17ab656d7b8 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 @@ -68,7 +68,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 +148,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 +164,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 +192,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str .withContext( context -> service - .listByResourceGroup( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -221,10 +222,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 +249,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 +277,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 +295,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 +313,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 +330,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 +348,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 +409,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 +466,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 +513,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 +531,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 +585,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 +635,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 +678,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 +697,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 +753,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 +805,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 +824,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 +862,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 +881,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 +942,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 +999,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 +1045,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 +1060,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 +1076,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 +1097,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 +1114,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..0efba59a0b283 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 @@ -28,13 +28,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())); } @@ -149,7 +149,7 @@ public void deleteById(String id) { 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) { 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..8720f93930784 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 @@ -86,7 +86,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 +133,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 +175,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 +189,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 +202,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 +216,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 +230,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 +267,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/ServiceTasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java new file mode 100644 index 0000000000000..45485a93a2fc5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java @@ -0,0 +1,1387 @@ +// 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.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.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 { + private final ClientLogger logger = new ClientLogger(ServiceTasksClientImpl.class); + + /** 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..3bb4d9b10bc30 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java @@ -0,0 +1,154 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceTasksImpl implements ServiceTasks { + @JsonIgnore private 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..11c9846327f78 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 @@ -202,7 +202,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 +244,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 +296,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 +358,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 +416,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 +429,7 @@ private PollerFlux, DataMigrationServiceIn this.client.getHttpPipeline(), DataMigrationServiceInner.class, DataMigrationServiceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -446,9 +448,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 +481,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 +505,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 +528,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 +554,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 +620,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 +670,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 +716,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 +757,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 +775,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 +826,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 +873,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 +896,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 +919,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 +938,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 +956,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 +974,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 +995,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 +1064,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 +1122,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 +1176,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 +1189,7 @@ private PollerFlux, DataMigrationServiceIn this.client.getHttpPipeline(), DataMigrationServiceInner.class, DataMigrationServiceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1197,9 +1204,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 +1232,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 +1252,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 +1271,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 +1293,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 +1351,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 +1400,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 +1445,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 +1486,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 +1503,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 +1551,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 +1596,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 +1617,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 +1637,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 +1654,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 +1670,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 +1687,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 +1735,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 +1784,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 +1830,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 +1852,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 +1873,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 +1891,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 +1908,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 +1926,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 +1975,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 +2033,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 +2087,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 +2105,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 +2123,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 +2140,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 +2156,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 +2190,7 @@ private Mono> nestedCheckNameAvailabilit .withContext( context -> service - .nestedCheckNameAvailability( + .checkChildrenNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -2202,10 +2212,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 +2244,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 +2264,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 +2292,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 +2307,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 +2323,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 +2375,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 +2424,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 +2442,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 +2459,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 +2475,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 +2488,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 +2535,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 +2577,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 +2592,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 +2606,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 +2621,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 +2636,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 +2670,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, context)) @@ -2675,7 +2687,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 +2719,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, context); @@ -2721,7 +2734,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 +2774,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 +2789,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 +2825,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 +2861,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 +2898,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 +2934,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 +2970,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..796e42cd7b305 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 @@ -121,10 +121,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 +132,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(), 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..5ddd2eed06e16 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java @@ -0,0 +1,2681 @@ +// 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(SqlMigrationServicesClientImpl.class); + + /** 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..0ba13ba42acef --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java @@ -0,0 +1,312 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlMigrationServicesImpl implements SqlMigrationServices { + @JsonIgnore private 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..eaf165a9a00a7 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 @@ -32,6 +32,7 @@ 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; @@ -169,6 +170,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 +211,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 +277,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 +339,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 +360,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 +383,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 +404,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 +425,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 +446,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 +513,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 +581,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 +632,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 +658,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 +719,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 +776,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 +803,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 +851,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 +871,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 +932,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 +994,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 +1014,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 +1054,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 +1081,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 +1148,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 +1216,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 +1267,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 +1291,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 +1350,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 +1405,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 +1451,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 +1459,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 +1675,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 +1711,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..86dfaa602e525 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,7 +10,9 @@ 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; @@ -104,6 +106,39 @@ 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) { @@ -204,9 +239,7 @@ public void deleteById(String id) { 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) { 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..dce53268ad33f 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 @@ -88,7 +88,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 +139,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 +186,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 +201,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 +216,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 +231,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 +245,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 +281,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/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/AvailableServiceSkuAutoGenerated.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java similarity index 70% 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..234797c6da370 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 @@ -11,8 +11,8 @@ /** SKU name, tier, etc. */ @Fluent -public final class AvailableServiceSkuAutoGenerated { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuAutoGenerated.class); +public final class AvailableServiceSkuSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuSku.class); /* * The name of the SKU @@ -33,7 +33,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 +52,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 +72,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 +92,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 +109,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..d1109b6515ff3 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 @@ -32,6 +32,12 @@ public final class AzureActiveDirectoryApp { @JsonProperty(value = "tenantId", required = true) 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,6 +98,26 @@ 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. * 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..987a02eabcd69 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Blob Details. */ +@Fluent +public final class AzureBlob { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBlob.class); + + /* + * 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..e81162c4ce717 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup Configuration. */ +@Fluent +public final class BackupConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupConfiguration.class); + + /* + * 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/BlobShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java index 27bdabe45418c..8179448e32423 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 @@ -17,7 +17,7 @@ public final class BlobShare { /* * SAS URI of Azure Storage Account Container. */ - @JsonProperty(value = "sasUri", required = true) + @JsonProperty(value = "sasUri") private String sasUri; /** @@ -46,10 +46,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..3ff3bd1c7d794 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to check for OCI drivers. */ +@Fluent +public final class CheckOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskInput.class); + + /* + * 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..f289959b0fe09 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskOutput.class); + + /* + * 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..5ca9e7c2b5cde --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskProperties.class); + + /* + * 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..242645f47604e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToMongoDbTaskProperties.class); + + /* + * 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..ffa846ae1532d 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 @@ -32,6 +32,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 +98,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. * 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..be33fc5a37c19 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..8c4a84119dcb6 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 @@ -10,7 +10,7 @@ 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); 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..0e4fa1823e0bb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.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.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 Oracle database connection. */ +@Fluent +public final class ConnectToSourceOracleSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskInput.class); + + /* + * 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(); + } + } +} 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..ba3302265c598 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.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.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 Oracle database connection. */ +@Immutable +public final class ConnectToSourceOracleSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskOutput.class); + + /* + * 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..88784159187bf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskProperties.class); + + /* + * 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/ConnectToSourcePostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java index b200fd27428c9..6430c1f19c3d6 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 @@ -11,6 +11,7 @@ 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 @@ -63,6 +64,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..29aa2649ab4f3 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 @@ -11,6 +11,7 @@ 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. @@ -62,6 +63,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..ba36c6318f3c5 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 @@ -26,6 +26,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 +44,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 +104,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 +164,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. * 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..dbd27115100fe 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 @@ -11,9 +11,10 @@ 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") @@ -24,35 +25,41 @@ public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends Conne 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 +67,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 +76,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 +85,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 +94,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 +103,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 +111,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 +137,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/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java index 6d0a589c4cc1a..35afbe6992a5b 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 @@ -39,6 +39,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 +90,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..f621c704f8da8 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +67,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..ae2fea7ceca05 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 @@ -26,6 +26,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 +72,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. * 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..317173226a864 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 @@ -11,6 +11,7 @@ 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") @@ -61,6 +62,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/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java index 3964143ddf8b1..6a328efd119e7 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 @@ -11,6 +11,7 @@ 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 @@ -65,6 +66,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..a639064f2f802 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java @@ -0,0 +1,64 @@ +// 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; + +/** + * Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.class); + + /* + * 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(); + } + } +} 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..21f68c2f4e84d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java @@ -0,0 +1,122 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.class); + + /* + * 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..7429133c934d4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem model. */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.class); + + /* + * 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..82496a862ac27 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,92 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * 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/ConnectToTargetSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java index 22dac03eb3807..489fcdbaec66e 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..5c95d34ff949f 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 @@ -20,6 +20,13 @@ public final class ConnectToTargetSqlDbTaskInput { @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 +47,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. * 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..ae3780c930dac 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +67,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/ConnectToTargetSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java index 1a060f8050c7f..a5f56041a5603 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..a8e44be465cb1 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 @@ -20,6 +20,25 @@ public final class ConnectToTargetSqlMITaskInput { @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 +59,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. * 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..7c750b8a99922 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..f761b47ac7d20 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 @@ -20,8 +20,10 @@ 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) }) 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..56d82db28ac10 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,29 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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 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 +38,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 +58,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/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/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/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/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..cbf44e5e73f62 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Database Migrations. */ +@Immutable +public final class DatabaseMigrationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationListResult.class); + + /* + * 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..95841b61295af --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java @@ -0,0 +1,251 @@ +// 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; +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 = "SqlMi", value = DatabaseMigrationPropertiesSqlMi.class), + @JsonSubTypes.Type(name = "SqlVm", value = DatabaseMigrationPropertiesSqlVm.class) +}) +@Fluent +public class DatabaseMigrationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationProperties.class); + + /* + * 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; + + /* + * 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 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/DatabaseMigrationPropertiesSqlMi.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java new file mode 100644 index 0000000000000..40ebae9b45e7a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java @@ -0,0 +1,193 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationPropertiesSqlMi.class); + + /* + * 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..947532c0fa716 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java @@ -0,0 +1,193 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseMigrationPropertiesSqlVm.class); + + /* + * 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/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/DatabaseMigrationsSqlMis.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java new file mode 100644 index 0000000000000..ad8345c2ed2d6 --- /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 The child resources to include 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 The child resources to include 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..df31d35e0a8b8 --- /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 The child resources to include 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 The child resources to include 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/DatabaseTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java new file mode 100644 index 0000000000000..bfa25420d87e1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Table properties. */ +@Immutable +public final class DatabaseTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseTable.class); + + /* + * 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/DataMigrationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java similarity index 55% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java index 032c7fc72ec11..642580dac0439 100644 --- 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/ErrorInfo.java @@ -4,55 +4,44 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Fluent; +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; -/** Migration Task errors. */ -@Fluent -public final class DataMigrationError { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationError.class); +/** Error details. */ +@Immutable +public final class ErrorInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorInfo.class); /* - * Error description + * Error code. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; /* - * Type of error. - */ - @JsonProperty(value = "type") - private ErrorType type; - - /** - * Get the message property: Error description. - * - * @return the message value. + * Error message. */ - public String message() { - return this.message; - } + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; /** - * Get the type property: Type of error. + * Get the code property: Error code. * - * @return the type value. + * @return the code value. */ - public ErrorType type() { - return this.type; + public String code() { + return this.code; } /** - * Set the type property: Type of error. + * Get the message property: Error message. * - * @param type the type value to set. - * @return the DataMigrationError object itself. + * @return the message value. */ - public DataMigrationError withType(ErrorType type) { - this.type = type; - return this; + public String message() { + return this.message; } /** 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..4efc3ba6a74a0 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 @@ -7,6 +7,7 @@ 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; @@ -19,19 +20,19 @@ public final class ExecutionStatistics { /* * 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 +40,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 +64,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 +84,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 +104,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 +144,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 +164,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 61% 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..00dba58191e6c 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 @@ -6,50 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; import com.fasterxml.jackson.annotation.JsonIgnore; 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileList.class); /* - * 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 +58,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/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/GetTdeCertificatesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java index 34b44e3a61c6a..ecdf5e3eb244d 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..3972ea998fe1d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java @@ -0,0 +1,91 @@ +// 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; +import java.util.List; + +/** Input for the task that collects user tables for the given list of databases. */ +@Fluent +public final class GetUserTablesMySqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesMySqlTaskInput.class); + + /* + * 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")); + } + } +} 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..c72231efc92ab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.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.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 GetUserTablesMySqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesMySqlTaskOutput.class); + + /* + * 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..b02f0ae34029c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.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.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("GetUserTablesMySql") +@Fluent +public final class GetUserTablesMySqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesMySqlTaskProperties.class); + + /* + * 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..9c1d27e824dd8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java @@ -0,0 +1,91 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskInput.class); + + /* + * 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")); + } + } +} 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..83d9a54547348 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java @@ -0,0 +1,76 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskOutput.class); + + /* + * 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..0f6c8f3919b2f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.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.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 Oracle schemas. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesOracle") +@Fluent +public final class GetUserTablesOracleTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskProperties.class); + + /* + * 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..a243e8ef25867 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java @@ -0,0 +1,91 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskInput.class); + + /* + * 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")); + } + } +} 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..1c1dd1a58d31a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java @@ -0,0 +1,76 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskOutput.class); + + /* + * 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..d12fa10b27a87 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.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.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("GetUserTablesPostgreSql") +@Fluent +public final class GetUserTablesPostgreSqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskProperties.class); + + /* + * 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/GetUserTablesSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java index 66edd726e08cd..5c45bd81a0083 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..551373a644672 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 @@ -27,6 +27,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 +73,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. * 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..ff062577b36fc 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +67,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..8a9ee837c58f8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to install an OCI driver. */ +@Fluent +public final class InstallOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskInput.class); + + /* + * 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..a4260c4da0fde --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.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.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 service task to install an OCI driver. */ +@Immutable +public final class InstallOciDriverTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskOutput.class); + + /* + * 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..d795cd487c6b0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskProperties.class); + + /* + * 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/MigrateMISyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java index 3421f0b1b1616..afc8ad474ba69 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -15,7 +16,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") @JsonTypeName("Migrate.SqlServer.AzureDbSqlMi.Complete") @Fluent -public final class MigrateMISyncCompleteCommandProperties extends CommandProperties { +public final class MigrateMISyncCompleteCommandProperties extends CommandPropertiesInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandProperties.class); /* 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..87fdd2b21c7b3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMongoDbTaskProperties.class); + + /* + * 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..133880c9946b5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java @@ -0,0 +1,109 @@ +// 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.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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.class); + + /* + * 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..180343d6ed016 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java @@ -0,0 +1,246 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskInput.class); + + /* + * 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()); + } + } +} 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..77229132c107a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.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.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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskOutput.class); + + /* + * 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..0b0af6d0ada03 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java @@ -0,0 +1,264 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.class); + + /* + * 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..02bca9c900c13 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.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.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; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.class); + + /* + * 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..9910fca958b44 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java @@ -0,0 +1,292 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.class); + + /* + * 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..2dfcc7b0e97f0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.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.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; + +/** The MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.class); + + /* + * 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..91ac952a82b66 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java @@ -0,0 +1,140 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskProperties.class); + + /* + * 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..de8b6c2146358 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 @@ -7,6 +7,7 @@ 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; @@ -33,20 +34,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 +160,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/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java index 5d92873f0f5ba..1434807b9001e 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 @@ -11,6 +11,7 @@ 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") @@ -61,6 +62,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..5f97ffbcafe6a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.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.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 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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * 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..f18ed0b2af0c9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,242 @@ +// 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.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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.class); + + /* + * 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..b46b3b1452903 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java @@ -0,0 +1,133 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskInput.class); + + /* + * 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(); + } + } +} 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..711e872b6b0ca --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,62 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutput.class); + + /* + * 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..61048a97f3a29 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.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.JsonIgnore; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.class); + + /* + * 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..2b769cf31b93d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,259 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.class); + + /* + * 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..ba6b7b6cff0fb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.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.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; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.class); + + /* + * 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..28372f8df6f17 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,124 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.class); + + /* + * 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..2eb4aa96fa669 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.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.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; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.class); + + /* + * 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..dd7ca7744f6b0 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 @@ -7,7 +7,9 @@ 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. */ @@ -22,6 +24,12 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { @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 +41,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 +84,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 +120,7 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetDatabase * * @return the migrationSetting value. */ - public Map migrationSetting() { + public Map migrationSetting() { return this.migrationSetting; } @@ -105,7 +131,7 @@ public Map migrationSetting() { * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. */ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withMigrationSetting( - Map migrationSetting) { + Map migrationSetting) { this.migrationSetting = migrationSetting; return this; } @@ -150,11 +176,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..b39a35b3fee72 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Selected tables for the migration. */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.class); + + /* + * 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..ca767fad42d5e 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 @@ -8,6 +8,7 @@ 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. */ @@ -34,6 +35,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 +110,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. * 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..1b90cb66ff5f3 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,17 +4,18 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; /** 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 @@ -27,6 +28,12 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError @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 +43,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 +75,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..db5e04a332477 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; @@ -15,7 +15,7 @@ /** 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 @@ -58,6 +58,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 +136,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/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java index cb2a0c76724a5..3912a46390f3a 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 @@ -11,12 +11,13 @@ 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 @@ -34,6 +35,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 +83,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..ec40794726ede --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,131 @@ +// 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 input for migrate schema Sql Server to Azure SQL Server scenario. */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbDatabaseInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbDatabaseInput.class); + + /* + * 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..e1b60d8db6fc7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java @@ -0,0 +1,128 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskInput.class); + + /* + * 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()); + } + } +} 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..529a656a033c0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.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.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; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutput.class); + + /* + * 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..24f907ae5c9ba --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,182 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.class); + + /* + * 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..9bac41baa6aaa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,60 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputError.class); + + /* + * 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..2b7640c69ddcb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,137 @@ +// 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; +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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.class); + + /* + * 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..ab1fc91c7efb8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java @@ -0,0 +1,164 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskProperties.class); + + /* + * 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..adcdc53667d3d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.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.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; + +/** The MigrateSchemaSqlTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlTaskOutputError.class); + + /* + * 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..9eee0b72199a9 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 @@ -7,6 +7,7 @@ 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; @@ -38,8 +39,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 +136,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..2a6e0132672d0 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 @@ -7,6 +7,7 @@ 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; @@ -43,24 +44,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/MigrateSqlServerSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java index 13f16a3264acf..846785ee6dab1 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 @@ -11,6 +11,7 @@ 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") @@ -60,6 +61,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..092386ff1371b 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 @@ -37,6 +37,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 +100,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) { 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..91241075ce37d 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 @@ -13,7 +13,7 @@ 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 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..f13fbe0158ed5 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 @@ -12,7 +12,7 @@ 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 @@ -22,6 +22,12 @@ public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult 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 +84,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..98048bbdabeaa 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 @@ -11,7 +11,7 @@ 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 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..47fca6acfeb85 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; @@ -13,10 +13,10 @@ 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); @@ -69,12 +69,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 +185,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 migrationReport value. + * @return the migrationValidationResult value. */ - public MigrationReportResult migrationReport() { - return this.migrationReport; + 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 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 MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult( + MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; } /** @@ -241,8 +281,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..f0717201df2e7 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 @@ -12,7 +12,7 @@ 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 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..fd15b20d2fed8 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 @@ -7,12 +7,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.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 @@ -20,6 +21,12 @@ public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends Migra @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 +37,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 +47,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..888cf86ed9b5b 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +79,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..c1cfabac26481 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 @@ -39,6 +39,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 +125,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. * 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..fd2c613d42b46 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,16 +4,44 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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. */ -@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 public MigrateSqlServerSqlMISyncTaskInput withSelectedDatabases( 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..9eb3cd811cd80 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +67,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..6f42bbef96797 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 @@ -21,6 +21,12 @@ public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput @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 +60,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 +95,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 +217,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) { 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..9e062fbae8c3f 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 @@ -11,6 +11,7 @@ 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") @@ -31,6 +32,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 +85,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..ce1e9fdba6c6e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskInput.class); + + /* + * 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(); + } + } +} 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..a145ac3eaa489 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.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.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; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutput.class); + + /* + * 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..39587f5dca6a9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.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.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; + +/** The MigrateSsisTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSsisTaskOutputMigrationLevel extends MigrateSsisTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutputMigrationLevel.class); + + /* + * 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..bdfe27311005d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java @@ -0,0 +1,155 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutputProjectLevel.class); + + /* + * 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..70c91db41554c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskProperties.class); + + /* + * 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/MigrateSyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java index 164677855ca81..94a686407a179 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 @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -15,7 +16,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") @JsonTypeName("Migrate.Sync.Complete.Database") @Fluent -public final class MigrateSyncCompleteCommandProperties extends CommandProperties { +public final class MigrateSyncCompleteCommandProperties extends CommandPropertiesInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandProperties.class); /* @@ -30,6 +31,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 +66,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/MigrationOperationInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java new file mode 100644 index 0000000000000..d73cc4be476b5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.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.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.UUID; + +/** Migration Operation Input. */ +@Fluent +public final class MigrationOperationInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationOperationInput.class); + + /* + * 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..d6f31bd5d9041 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,26 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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 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 +35,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 +55,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..527b80c1a338c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java @@ -0,0 +1,229 @@ +// 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; +import java.util.List; + +/** Detailed status of current migration. */ +@Immutable +public final class MigrationStatusDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationStatusDetails.class); + + /* + * 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..e61c0aeba9f43 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,188 @@ +// 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; +import java.time.OffsetDateTime; + +/** Database level validation results. */ +@Immutable +public class MigrationValidationDatabaseLevelResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationDatabaseLevelResult.class); + + /* + * 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/MigrationValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java new file mode 100644 index 0000000000000..000bb5dd93840 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java @@ -0,0 +1,111 @@ +// 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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Migration Validation Result. */ +@Fluent +public class MigrationValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationResult.class); + + /* + * 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..6574a574c8400 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java @@ -0,0 +1,60 @@ +// 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.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCancelCommand.class); + + /* + * 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..21d547022cef7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java @@ -0,0 +1,149 @@ +// 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; +import java.util.List; + +/** Describes a MongoDB data source. */ +@Fluent +public final class MongoDbClusterInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbClusterInfo.class); + + /* + * 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")); + } + } +} 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..861c5667a4c1d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java @@ -0,0 +1,259 @@ +// 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; + +/** Describes a supported collection within a MongoDB database. */ +@Fluent +public final class MongoDbCollectionInfo extends MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionInfo.class); + + /* + * 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(); + } + } +} 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..80e5cc7bb1dcc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java @@ -0,0 +1,122 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionProgress.class); + + /** {@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..c64cd7c6fa85c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java @@ -0,0 +1,111 @@ +// 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; + +/** Describes how an individual MongoDB collection should be migrated. */ +@Fluent +public final class MongoDbCollectionSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionSettings.class); + + /* + * 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..6dd7947985bd8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the input to the 'cancel' and 'restart' MongoDB migration commands. */ +@Fluent +public class MongoDbCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCommandInput.class); + + /* + * 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..6fa5866f1fbf2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java @@ -0,0 +1,288 @@ +// 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; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbConnectionInfo.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** {@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")); + } + } +} 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..ad76b5ba109e6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java @@ -0,0 +1,124 @@ +// 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; +import java.util.List; + +/** Describes a database within a MongoDB data source. */ +@Fluent +public final class MongoDbDatabaseInfo extends MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseInfo.class); + + /* + * 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()); + } + } +} 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..c3f1649033e3b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java @@ -0,0 +1,164 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseProgress.class); + + /* + * 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..0573b2d52de49 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java @@ -0,0 +1,101 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseSettings.class); + + /* + * 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(); + } + }); + } + } +} 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..d2e66a326bc48 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java @@ -0,0 +1,130 @@ +// 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; + +/** Describes an error or warning that occurred during a MongoDB migration. */ +@Fluent +public final class MongoDbError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbError.class); + + /* + * 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..55c0e153f0ca0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java @@ -0,0 +1,60 @@ +// 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.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbFinishCommand.class); + + /* + * 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..87821778208b7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the input to the 'finish' MongoDB migration command. */ +@Fluent +public final class MongoDbFinishCommandInput extends MongoDbCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbFinishCommandInput.class); + + /* + * 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..29d69b2752cd8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java @@ -0,0 +1,164 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbMigrationProgress.class); + + /* + * 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..ab956c4144fe8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java @@ -0,0 +1,229 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbMigrationSettings.class); + + /* + * 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(); + } + } +} 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..74df859fb2e14 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java @@ -0,0 +1,168 @@ +// 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; + +/** Describes a database or collection within a MongoDB data source. */ +@Fluent +public class MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbObjectInfo.class); + + /* + * 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")); + } + } +} 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..6372fffedc87b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java @@ -0,0 +1,428 @@ +// 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.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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbProgress.class); + + /* + * 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")); + } + } +} 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..bafda0798e526 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java @@ -0,0 +1,60 @@ +// 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.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbRestartCommand.class); + + /* + * 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..5f8c6333db702 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a field reference within a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyField { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeyField.class); + + /* + * 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")); + } + } +} 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..ddb20e87f7015 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeyInfo.class); + + /* + * 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()); + } + } +} 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..6dab9931e493f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeySetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeySetting.class); + + /* + * 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()); + } + } +} 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..73fa1cd2295fe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java @@ -0,0 +1,106 @@ +// 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; + +/** Specifies resource limits for the migration. */ +@Fluent +public final class MongoDbThrottlingSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbThrottlingSettings.class); + + /* + * 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..3ccf8e449dad8 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 @@ -24,12 +24,30 @@ public final class MySqlConnectionInfo extends ConnectionInfo { @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; + /** * Get the serverName property: Name of the server. * @@ -50,6 +68,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 +108,46 @@ 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; + } + /** {@inheritDoc} */ @Override public MySqlConnectionInfo withUsername(String username) { 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..1276ea54d532e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.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.annotation.Immutable; +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; + +/** The NodeMonitoringData model. */ +@Immutable +public final class NodeMonitoringData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeMonitoringData.class); + + /* + * 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..42f61415ed19c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Offline configuration. */ +@Fluent +public final class OfflineConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OfflineConfiguration.class); + + /* + * 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..609c3dcb18e60 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the request to list SQL operations. */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * 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..e7683d3fcfff7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsDisplayDefinition model. */ +@Immutable +public final class OperationsDisplayDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsDisplayDefinition.class); + + /* + * 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..93f67997b3002 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.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.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; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OracleConnectionInfo.class); + + /* + * EZConnect or TNSName connection string. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /** + * 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; + } + + /** {@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")); + } + } +} 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..24535c7f73c8c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.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.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 an Oracle OCI driver. */ +@Immutable +public final class OracleOciDriverInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OracleOciDriverInfo.class); + + /* + * 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/PostgreSqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java index c5d11ea8e2bfb..6333b6124aecf 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 @@ -24,6 +24,18 @@ public final class PostgreSqlConnectionInfo extends ConnectionInfo { @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 +48,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 +98,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 +178,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) { 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..81d2a2465e919 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java @@ -0,0 +1,140 @@ +// 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; +import java.time.OffsetDateTime; + +/** Base class for file properties. */ +@Fluent +public final class ProjectFileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectFileProperties.class); + + /* + * 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/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..4261bd820deff 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,18 @@ 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.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import com.fasterxml.jackson.annotation.JsonIgnore; +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 +27,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 +39,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 +61,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 +74,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,9 +91,14 @@ @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); @@ -91,7 +118,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 +150,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..b6b0bbc6f6e7c 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,26 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; /** 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 +35,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 +55,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..12afa6ab78789 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,38 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; /** 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 +47,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 +67,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 +87,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 +107,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/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..20ae37d6b8bd0 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 @@ -17,7 +17,7 @@ public final class ReportableException { /* * Error message */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "message") private String message; /* @@ -29,25 +29,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 +59,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 +99,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 +119,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 +139,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 +159,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/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/ResourceType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java new file mode 100644 index 0000000000000..bb50248dd3b10 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.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 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"); + + /** + * 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..ffef07e019366 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 @@ -7,6 +7,7 @@ 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; @@ -18,25 +19,27 @@ public final class SchemaComparisonValidationResult { /* * 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 +51,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 +72,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..07124df97fd22 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,33 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; /** 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 +42,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 +62,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 +82,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..5744f737d2a65 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java @@ -0,0 +1,103 @@ +// 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; + +/** Settings for migrating schema from source to target. */ +@Fluent +public final class SchemaMigrationSetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaMigrationSetting.class); + + /* + * 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/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..b9a610ed72ec3 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 @@ -9,7 +9,7 @@ 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); 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..34b483f823ce4 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 @@ -21,7 +21,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 +69,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 +78,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/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..8b45090c1038a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Source Location details of backups. */ +@Fluent +public final class SourceLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceLocation.class); + + /* + * Source File share. + */ + @JsonProperty(value = "fileShare") + private SqlFileShare fileShare; + + /* + * Source Azure Blob. + */ + @JsonProperty(value = "azureBlob") + private AzureBlob azureBlob; + + /** + * 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; + } + + /** + * 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..111aaee177753 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java @@ -0,0 +1,145 @@ +// 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; + +/** Information of backup file. */ +@Immutable +public final class SqlBackupFileInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlBackupFileInfo.class); + + /* + * 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..55771d1e2f5c3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java @@ -0,0 +1,195 @@ +// 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; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** Information of backup set. */ +@Immutable +public final class SqlBackupSetInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlBackupSetInfo.class); + + /* + * 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..b670212b249b1 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 @@ -25,6 +25,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 +106,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. * 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..0ac2ba60438f8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java @@ -0,0 +1,180 @@ +// 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; + +/** Source SQL Connection. */ +@Fluent +public final class SqlConnectionInformation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlConnectionInformation.class); + + /* + * 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/SqlFileShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java new file mode 100644 index 0000000000000..ca00ad991a347 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** File share. */ +@Fluent +public final class SqlFileShare { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlFileShare.class); + + /* + * 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..e529c055f5c59 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of SQL Migration Service. */ +@Immutable +public final class SqlMigrationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationListResult.class); + + /* + * 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..e8f36c6ab400a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.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.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; + +/** An update to a SQL Migration Service. */ +@Fluent +public final class SqlMigrationServiceUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationServiceUpdate.class); + + /* + * 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/SsisMigrationInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java new file mode 100644 index 0000000000000..5112d11359853 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSIS migration info with SSIS store type, overwrite policy. */ +@Fluent +public final class SsisMigrationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisMigrationInfo.class); + + /* + * 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/TargetLocation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java new file mode 100644 index 0000000000000..568d8b54bdf88 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java @@ -0,0 +1,76 @@ +// 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; + +/** Target Location details for optional copy of backups. */ +@Fluent +public final class TargetLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TargetLocation.class); + + /* + * 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/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..8ba8bfe9b7200 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Input for the service task to upload an OCI driver. */ +@Fluent +public final class UploadOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskInput.class); + + /* + * 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..0f8b925c56727 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.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.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 service task to upload an OCI driver. */ +@Immutable +public final class UploadOciDriverTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskOutput.class); + + /* + * 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..88c95ff03faa9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskProperties.class); + + /* + * 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..c3fc582a78c81 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 @@ -11,6 +11,7 @@ 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") @@ -62,6 +63,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..514f999756f1b 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,13 +4,13 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; 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); 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..3faada05288a4 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 @@ -11,6 +11,7 @@ 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") @@ -62,6 +63,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/ValidateMigrationInputSqlServerSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java index 279ddf01f5f3f..3d82611d61266 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 @@ -11,6 +11,7 @@ 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") @@ -62,6 +63,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..893c3623f87eb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.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.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 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateMongoDbTaskProperties.class); + + /* + * 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..a0115d61b6df3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.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.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 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 { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * 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..6256ba4f9e9cf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.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.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 Oracle to Azure Database for PostgreSQL for online migrations. */ +@Immutable +public final class ValidateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateOracleAzureDbPostgreSqlSyncTaskOutput.class); + + /* + * 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/ValidationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java index cd719a8a55de3..47aa92ad70f76 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,26 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +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; /** 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 +35,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 +55,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..12a122c8b73cf --- /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-01-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..7d033369a2eaf --- /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-01-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..aaf9031c62646 --- /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-01-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..4bf5f2c025ee9 --- /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-01-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..9aa640a69734c --- /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-01-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..6c1bba4270dcb --- /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-01-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..ccf59c35b3d93 --- /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-01-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..2f61f89724963 --- /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-01-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); + } +}