From 51563016f3ba77437c7402c384f18d3483c1c787 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Jun 2021 08:56:51 +0000 Subject: [PATCH] CodeGen from PR 15001 in Azure/azure-rest-api-specs [python]track2 config (#15001) * track2 config * directive for required type in readme.python.md * Update readme.md * Update readme.python.md * Update readme.python.md --- .../CHANGELOG.md | 3 +- .../README.md | 16 +- .../pom.xml | 141 +- .../datamigration/DataMigrationManager.java | 46 +- .../fluent/DataMigrationManagementClient.java | 14 + .../datamigration/fluent/FilesClient.java | 256 +++ .../datamigration/fluent/ProjectsClient.java | 4 +- .../fluent/ServiceTasksClient.java | 216 +++ .../datamigration/fluent/ServicesClient.java | 4 +- .../datamigration/fluent/TasksClient.java | 43 + .../fluent/models/CommandPropertiesInner.java | 83 + .../models/DataMigrationServiceInner.java | 27 + .../fluent/models/FileStorageInfoInner.java | 77 + .../models/NameAvailabilityResponseInner.java | 43 +- .../fluent/models/ProjectFileInner.java | 81 + .../implementation/CommandPropertiesImpl.java | 46 + .../DataMigrationManagementClientImpl.java | 30 +- .../DataMigrationServiceImpl.java | 17 +- .../implementation/FileStorageInfoImpl.java | 43 + .../implementation/FilesClientImpl.java | 1562 +++++++++++++++++ .../implementation/FilesImpl.java | 267 +++ .../implementation/ProjectFileImpl.java | 168 ++ .../implementation/ProjectTaskImpl.java | 12 + .../implementation/ProjectsClientImpl.java | 40 +- .../implementation/ProjectsImpl.java | 8 +- .../ServiceTasksClientImpl.java | 1387 +++++++++++++++ .../implementation/ServiceTasksImpl.java | 154 ++ .../implementation/ServicesClientImpl.java | 28 +- .../implementation/ServicesImpl.java | 8 +- .../implementation/TasksClientImpl.java | 226 +++ .../implementation/TasksImpl.java | 35 + .../AvailableServiceSkuAutoGenerated.java | 7 +- .../models/CheckOciDriverTaskInput.java | 50 + .../models/CheckOciDriverTaskOutput.java | 72 + .../models/CheckOciDriverTaskProperties.java | 86 + .../models/CommandProperties.java | 61 +- .../ConnectToMongoDbTaskProperties.java | 86 + .../ConnectToSourceMySqlTaskProperties.java | 8 + .../ConnectToSourceNonSqlTaskOutput.java | 2 +- .../ConnectToSourceOracleSyncTaskInput.java | 58 + .../ConnectToSourceOracleSyncTaskOutput.java | 88 + ...nnectToSourceOracleSyncTaskProperties.java | 86 + ...tToSourcePostgreSqlSyncTaskProperties.java | 8 + ...ctToSourceSqlServerSyncTaskProperties.java | 8 + .../ConnectToSourceSqlServerTaskInput.java | 81 + ...ourceSqlServerTaskOutputAgentJobLevel.java | 41 +- ...tToSourceSqlServerTaskOutputTaskLevel.java | 16 + ...onnectToSourceSqlServerTaskProperties.java | 8 + ...ToTargetAzureDbForMySqlTaskProperties.java | 8 + ...zureDbForPostgreSqlSyncTaskProperties.java | 8 + ...acleAzureDbForPostgreSqlSyncTaskInput.java | 64 + ...cleAzureDbForPostgreSqlSyncTaskOutput.java | 122 ++ ...qlSyncTaskOutputDatabaseSchemaMapItem.java | 80 + ...zureDbForPostgreSqlSyncTaskProperties.java | 92 + ...onnectToTargetSqlDbSyncTaskProperties.java | 8 + .../ConnectToTargetSqlDbTaskProperties.java | 8 + ...onnectToTargetSqlMISyncTaskProperties.java | 8 + .../models/ConnectToTargetSqlMITaskInput.java | 81 + .../ConnectToTargetSqlMITaskProperties.java | 8 + .../datamigration/models/ConnectionInfo.java | 2 + .../models/DataIntegrityValidationResult.java | 30 +- .../models/DataMigrationError.java | 6 +- .../models/DataMigrationService.java | 40 +- .../datamigration/models/DatabaseTable.java | 54 + .../models/ExecutionStatistics.java | 65 +- .../datamigration/models/FileList.java | 81 + .../datamigration/models/FileStorageInfo.java | 32 + .../datamigration/models/Files.java | 217 +++ .../GetTdeCertificatesSqlTaskProperties.java | 8 + .../models/GetUserTablesOracleTaskInput.java | 91 + .../models/GetUserTablesOracleTaskOutput.java | 76 + .../GetUserTablesOracleTaskProperties.java | 86 + .../GetUserTablesPostgreSqlTaskInput.java | 91 + .../GetUserTablesPostgreSqlTaskOutput.java | 76 + ...GetUserTablesPostgreSqlTaskProperties.java | 86 + .../GetUserTablesSqlSyncTaskProperties.java | 8 + .../GetUserTablesSqlTaskProperties.java | 8 + .../models/InstallOciDriverTaskInput.java | 50 + .../models/InstallOciDriverTaskOutput.java | 43 + .../InstallOciDriverTaskProperties.java | 86 + ...igrateMISyncCompleteCommandProperties.java | 3 +- .../models/MigrateMongoDbTaskProperties.java | 86 + ...MySqlAzureDbForMySqlSyncDatabaseInput.java | 26 + ...ySqlAzureDbForMySqlSyncTaskProperties.java | 8 + ...zureDbForPostgreSqlSyncTaskProperties.java | 88 + ...cleAzureDbPostgreSqlSyncDatabaseInput.java | 237 +++ ...eOracleAzureDbPostgreSqlSyncTaskInput.java | 133 ++ ...OracleAzureDbPostgreSqlSyncTaskOutput.java | 62 + ...PostgreSqlSyncTaskOutputDatabaseError.java | 90 + ...PostgreSqlSyncTaskOutputDatabaseLevel.java | 259 +++ ...eAzureDbPostgreSqlSyncTaskOutputError.java | 50 + ...ostgreSqlSyncTaskOutputMigrationLevel.java | 124 ++ ...eDbPostgreSqlSyncTaskOutputTableLevel.java | 228 +++ ...AzureDbForPostgreSqlSyncDatabaseInput.java | 31 + ...DbForPostgreSqlSyncDatabaseTableInput.java | 52 + ...ostgreSqlSyncTaskOutputMigrationLevel.java | 45 + ...zureDbForPostgreSqlSyncTaskProperties.java | 10 +- ...rateSchemaSqlServerSqlDbDatabaseInput.java | 105 ++ .../MigrateSchemaSqlServerSqlDbTaskInput.java | 76 + ...MigrateSchemaSqlServerSqlDbTaskOutput.java | 56 + ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 182 ++ ...teSchemaSqlServerSqlDbTaskOutputError.java | 60 + ...qlServerSqlDbTaskOutputMigrationLevel.java | 137 ++ ...ateSchemaSqlServerSqlDbTaskProperties.java | 86 + .../MigrateSchemaSqlTaskOutputError.java | 48 + ...grateSqlServerSqlDbSyncTaskProperties.java | 8 + .../MigrateSqlServerSqlDbTaskOutput.java | 8 +- ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 2 +- ...skOutputDatabaseLevelValidationResult.java | 182 -- .../MigrateSqlServerSqlDbTaskOutputError.java | 2 +- ...qlServerSqlDbTaskOutputMigrationLevel.java | 67 +- ...ateSqlServerSqlDbTaskOutputTableLevel.java | 2 +- .../MigrateSqlServerSqlDbTaskProperties.java | 8 + ...grateSqlServerSqlMISyncTaskProperties.java | 8 + .../MigrateSqlServerSqlMITaskInput.java | 30 + .../MigrateSqlServerSqlMITaskProperties.java | 8 + .../models/MigrateSsisTaskInput.java | 74 + .../models/MigrateSsisTaskOutput.java | 52 + .../MigrateSsisTaskOutputMigrationLevel.java | 185 ++ .../MigrateSsisTaskOutputProjectLevel.java | 155 ++ .../models/MigrateSsisTaskProperties.java | 86 + .../MigrateSyncCompleteCommandProperties.java | 3 +- .../models/MigrationReportResult.java | 30 +- ...lt.java => MigrationValidationResult.java} | 32 +- .../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 | 80 + .../models/MongoDbDatabaseInfo.java | 124 ++ .../models/MongoDbDatabaseProgress.java | 162 ++ .../models/MongoDbDatabaseSettings.java | 99 ++ .../datamigration/models/MongoDbError.java | 130 ++ .../models/MongoDbErrorType.java | 37 + .../models/MongoDbFinishCommand.java | 60 + .../models/MongoDbFinishCommandInput.java | 63 + .../models/MongoDbMigrationProgress.java | 162 ++ .../models/MongoDbMigrationSettings.java | 227 +++ .../models/MongoDbMigrationState.java | 61 + .../models/MongoDbObjectInfo.java | 168 ++ .../datamigration/models/MongoDbProgress.java | 426 +++++ .../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/OracleConnectionInfo.java | 75 + .../models/OracleOciDriverInfo.java | 117 ++ .../models/PostgreSqlConnectionInfo.java | 52 + .../datamigration/models/ProjectFile.java | 218 +++ .../models/ProjectFileProperties.java | 140 ++ .../models/ProjectSourcePlatform.java | 9 + .../models/ProjectTargetPlatform.java | 12 + .../datamigration/models/ProjectTask.java | 26 + .../models/ProjectTaskProperties.java | 60 +- .../datamigration/models/Projects.java | 4 +- .../models/QueryAnalysisValidationResult.java | 30 +- .../models/QueryExecutionResult.java | 56 +- .../models/ReplicateMigrationState.java | 46 + .../models/ReportableException.java | 65 +- .../datamigration/models/ScenarioSource.java | 61 + .../datamigration/models/ScenarioTarget.java | 49 + .../SchemaComparisonValidationResult.java | 27 +- .../SchemaComparisonValidationResultType.java | 43 +- .../models/SchemaMigrationOption.java | 37 + .../models/SchemaMigrationSetting.java | 77 + .../models/SchemaMigrationStage.java | 58 + .../models/ServerProperties.java | 2 +- .../datamigration/models/ServiceSku.java | 7 +- .../datamigration/models/ServiceTasks.java | 201 +++ .../datamigration/models/Services.java | 4 +- .../models/SsisMigrationInfo.java | 102 ++ .../models/SsisMigrationOverwriteOption.java | 34 + .../models/SsisMigrationStage.java | 40 + .../datamigration/models/SsisStoreType.java | 31 + .../SyncDatabaseMigrationReportingState.java | 21 + .../datamigration/models/Tasks.java | 41 + .../models/UploadOciDriverTaskInput.java | 53 + .../models/UploadOciDriverTaskOutput.java | 58 + .../models/UploadOciDriverTaskProperties.java | 86 + ...InputSqlServerSqlDbSyncTaskProperties.java | 8 + ...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 +- 195 files changed, 15703 insertions(+), 484 deletions(-) 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/models/CommandPropertiesInner.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/ProjectFileInner.java 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/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/ProjectFileImpl.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/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/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 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/FileList.java 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/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/MigrateMongoDbTaskProperties.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 delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.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 rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/{MigrateSqlServerSqlDbTaskOutputValidationResult.java => MigrationValidationResult.java} (77%) 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/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/ReplicateMigrationState.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 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/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/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 diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md index d518ea66cb153..515f92d930c65 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 (2021-06-28) +- 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-07-15-preview. 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..be1852daa02c4 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-2018-07-15-preview. 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,13 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). 1. Fork it 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml index 12fb39bdd567b..2b294b69921c3 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml +++ b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml @@ -1,67 +1,86 @@ - 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-2018-07-15-preview. + 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 - - - - - com.azure - azure-core - 1.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + 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 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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..58a122be8475e 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 @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; 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,20 +16,25 @@ 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.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.TasksImpl; import com.azure.resourcemanager.datamigration.implementation.UsagesImpl; +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.Tasks; import com.azure.resourcemanager.datamigration.models.Usages; @@ -48,12 +52,16 @@ public final class DataMigrationManager { private Tasks tasks; + private ServiceTasks serviceTasks; + private Projects projects; private Usages usages; private Operations operations; + private Files files; + private final DataMigrationManagementClient clientObject; private DataMigrationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -97,6 +105,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 +145,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,6 +212,9 @@ 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); } @@ -201,10 +224,7 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -241,6 +261,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) { @@ -265,6 +293,14 @@ public Operations operations() { return operations; } + /** @return Resource collection API of Files. */ + public Files files() { + if (this.files == null) { + this.files = new FilesImpl(clientObject.getFiles(), this); + } + return files; + } + /** * @return Wrapped service client DataMigrationManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. 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..94fb3a37b8eac 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 @@ -65,6 +65,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. * @@ -85,4 +92,11 @@ public interface DataMigrationManagementClient { * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the FilesClient object to access its operations. + * + * @return the FilesClient object. + */ + FilesClient getFiles(); } 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..d278d4bcdba56 --- /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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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. + */ + @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. + */ + @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. + */ + @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/ProjectsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java index 659400016b56d..270588b473318 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 @@ -25,7 +25,7 @@ public interface ProjectsClient { * @return oData page of project resources. */ @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 @@ -40,7 +40,7 @@ public interface ProjectsClient { * @return oData page of project resources. */ @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 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..1a7707fd29293 --- /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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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. + */ + @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. + */ + @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..a9e15d273c598 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 @@ -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); /** @@ -481,7 +481,7 @@ NameAvailabilityResponseInner nestedCheckNameAvailability( * @return indicates whether a proposed resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, 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..3ca5c1e6e19f7 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. */ @@ -243,4 +244,46 @@ Response updateWithResponse( @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. + */ + @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/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..b3d673d5ea322 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 @@ -58,6 +58,13 @@ public class DataMigrationServiceInner extends Resource { @JsonProperty(value = "properties.virtualSubnetId") private String virtualSubnetId; + /* + * The ID of the Microsoft.Network/networkInterfaces resource which the + * service have + */ + @JsonProperty(value = "properties.virtualNicId") + private String virtualNicId; + /** * Get the etag property: HTTP strong entity tag value. Ignored if submitted. * @@ -169,6 +176,26 @@ public DataMigrationServiceInner withVirtualSubnetId(String 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 DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualNicId(String virtualNicId) { + this.virtualNicId = virtualNicId; + return this; + } + /** {@inheritDoc} */ @Override public DataMigrationServiceInner withLocation(String location) { 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..7c253e6c0ad0b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java @@ -0,0 +1,77 @@ +// Copyright (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; +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") + 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/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/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..817fe6ab2a1b9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java @@ -0,0 +1,81 @@ +// Copyright (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.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; + + /** + * 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; + } + + /** + * 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/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/DataMigrationManagementClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java index d8cb91cfe406e..e803c79fbbd21 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,9 +22,11 @@ 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.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.TasksClient; import com.azure.resourcemanager.datamigration.fluent.UsagesClient; @@ -151,6 +153,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; @@ -187,6 +201,18 @@ public OperationsClient getOperations() { return this.operations; } + /** The FilesClient object to access its operations. */ + private final FilesClient files; + + /** + * Gets the FilesClient object to access its operations. + * + * @return the FilesClient object. + */ + public FilesClient getFiles() { + return this.files; + } + /** * Initializes an instance of DataMigrationManagementClient client. * @@ -209,13 +235,15 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-04-19"; + this.apiVersion = "2018-07-15-preview"; 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..0b64fb8de8e40 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 @@ -72,6 +72,10 @@ public String virtualSubnetId() { return this.innerModel().virtualSubnetId(); } + public String virtualNicId() { + return this.innerModel().virtualNicId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -193,15 +197,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 +247,9 @@ public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { this.innerModel().withVirtualSubnetId(virtualSubnetId); return this; } + + public DataMigrationServiceImpl withVirtualNicId(String virtualNicId) { + this.innerModel().withVirtualNicId(virtualNicId); + return this; + } } 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..777eeaf13caec --- /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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..344eb69a649de --- /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).getValue(); + } + + 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/ProjectFileImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java new file mode 100644 index 0000000000000..58b6e4187c7a3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.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.implementation; + +import com.azure.core.http.rest.Response; +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 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/ProjectTaskImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java index 21110750efb08..824bf5d91c9e0 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 @@ -6,7 +6,9 @@ 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; +import com.azure.resourcemanager.datamigration.models.CommandProperties; import com.azure.resourcemanager.datamigration.models.ProjectTask; import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; @@ -149,6 +151,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..f00f023637a12 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, @@ -167,7 +167,7 @@ Mono> listByResourceGroupNext( * @return oData page of project resources. */ @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 +191,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str .withContext( context -> service - .listByResourceGroup( + .list( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -224,7 +224,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @return oData page of project resources. */ @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 +247,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, @@ -278,10 +278,9 @@ private Mono> listByResourceGroupSinglePageAsync( * @return oData page of project resources. */ @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)); } /** @@ -297,10 +296,10 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @return oData page of project resources. */ @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)); } /** @@ -315,8 +314,8 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @return oData page of project resources. */ @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)); } /** @@ -332,8 +331,8 @@ public PagedIterable listByResourceGroup(String groupName, String * @return oData page of project resources. */ @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)); } /** @@ -1062,7 +1061,7 @@ public Response updateWithResponse( * @return oData page of project resources. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1074,8 +1073,7 @@ private Mono> listByResourceGroupNextSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1099,7 +1097,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @return oData page of project resources. */ @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 +1110,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..3674cfb721bc4 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())); } 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..8d72c52e4bd11 --- /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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @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 the completion. + */ + @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 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..c544f1b85154b 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); @@ -2150,7 +2150,7 @@ public PagedIterable listSkus(String groupName, String * @return indicates whether a proposed resource name is available. */ @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 +2180,7 @@ private Mono> nestedCheckNameAvailabilit .withContext( context -> service - .nestedCheckNameAvailability( + .checkChildrenNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, @@ -2205,7 +2205,7 @@ private Mono> nestedCheckNameAvailabilit * @return indicates whether a proposed resource name is available. */ @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 +2233,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, @@ -2256,9 +2256,9 @@ private Mono> nestedCheckNameAvailabilit * @return indicates whether a proposed resource name is available. */ @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 +2281,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(); } /** @@ -2299,9 +2299,9 @@ public NameAvailabilityResponseInner nestedCheckNameAvailability( * @return indicates whether a proposed resource name is available. */ @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(); } /** @@ -2658,8 +2658,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, context)) @@ -2706,8 +2706,8 @@ private Mono> checkNameAvailabilityWithR .checkNameAvailability( this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, + this.client.getApiVersion(), parameters, accept, 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/TasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java index 89cfc26d5db04..9c9bf90ad7eaf 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}) @@ -1440,6 +1459,213 @@ 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. * 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..37dfad4176b93 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) { 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/AvailableServiceSkuAutoGenerated.java index eee7d0547d2aa..2928a8e81ad37 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/AvailableServiceSkuAutoGenerated.java @@ -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; @@ -99,7 +100,7 @@ public AvailableServiceSkuAutoGenerated withSize(String size) { } /** - * 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,7 +109,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 AvailableServiceSkuAutoGenerated object itself. 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/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/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..637b7d7215691 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,19 @@ 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; + /** * Get the sourceConnectionInfo property: Connection information for Source SQL Server. * @@ -79,6 +98,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 +158,48 @@ 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; + } + /** * 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..d50cec5659803 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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/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/ConnectToTargetSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java index 1471aa45c47f6..b4dcd8d269f05 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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..3066ec84ffb92 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,27 @@ 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.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") 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 +36,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 +56,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/DataMigrationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java index 032c7fc72ec11..805a9a6701bd7 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/DataMigrationError.java @@ -21,7 +21,7 @@ public final class DataMigrationError { private String message; /* - * Type of error. + * Error type */ @JsonProperty(value = "type") private ErrorType type; @@ -36,7 +36,7 @@ public String message() { } /** - * Get the type property: Type of error. + * Get the type property: Error type. * * @return the type value. */ @@ -45,7 +45,7 @@ public ErrorType type() { } /** - * Set the type property: Type of error. + * Set the type property: Error type. * * @param type the type value to set. * @return the DataMigrationError object itself. 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..e50f8f61102b4 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 @@ -90,6 +90,14 @@ 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 region of the resource. * @@ -161,7 +169,8 @@ interface WithCreate DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithPublicKey, - DefinitionStages.WithVirtualSubnetId { + DefinitionStages.WithVirtualSubnetId, + DefinitionStages.WithVirtualNicId { /** * Executes the create request. * @@ -240,6 +249,17 @@ 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); + } } /** * Begins update for the DataMigrationService resource. @@ -255,7 +275,8 @@ interface Update UpdateStages.WithKind, UpdateStages.WithSku, UpdateStages.WithPublicKey, - UpdateStages.WithVirtualSubnetId { + UpdateStages.WithVirtualSubnetId, + UpdateStages.WithVirtualNicId { /** * Executes the update request. * @@ -336,6 +357,17 @@ 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); + } } /** * Refreshes the resource to sync with Azure. @@ -425,7 +457,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. @@ -437,6 +469,6 @@ 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. */ - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( NameAvailabilityRequest parameters, Context context); } 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/ExecutionStatistics.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java index 2dede194c0d61..190c9843f2b76 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 @@ -19,19 +19,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; /* @@ -44,13 +44,13 @@ public final class ExecutionStatistics { /* * 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 +62,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 +82,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 +102,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 +142,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 +162,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/FileList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java new file mode 100644 index 0000000000000..00dba58191e6c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights 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.ProjectFileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of files. */ +@Fluent +public final class FileList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileList.class); + + /* + * List of files + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of files + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of files. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of files. + * + * @param value the value value to set. + * @return the FileList object itself. + */ + public FileList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of files. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of files. + * + * @param nextLink the nextLink value to set. + * @return the FileList object itself. + */ + public FileList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/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..e3a1d00d17105 --- /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. + */ + 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. + */ + 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. + */ + 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 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 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/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/GetUserTablesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java index 151d5e9e0aa90..1718f2f7c1604 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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/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/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java index 3a6a4bc75b42d..0f87fb438720d 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 @@ -47,6 +47,12 @@ public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { @JsonProperty(value = "targetSetting") private Map targetSetting; + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + /** * Get the name property: Name of the database. * @@ -149,6 +155,26 @@ public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTargetSetting(Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + /** * Validates the instance. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/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..ed35d733c3116 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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") + 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") + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + 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..b57ba1d200e6b 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 @@ -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.util.List; import java.util.Map; /** Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs. */ @@ -47,6 +48,12 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { @JsonProperty(value = "targetSetting") private Map targetSetting; + /* + * Tables selected for migration + */ + @JsonProperty(value = "selectedTables") + private List selectedTables; + /** * Get the name property: Name of the database. * @@ -150,11 +157,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/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java index 0e25dbdb56f59..7d8c2764540dc 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 @@ -58,6 +58,24 @@ 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; + /** * Get the startedOn property: Migration start time. * @@ -112,6 +130,33 @@ 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; + } + /** * 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..b30b53cfe7ade 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 @@ -64,6 +65,13 @@ public List output() { return this.output; } + /** {@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..713074574adaa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + + /* + * 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 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..73d5d10b18b61 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.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; +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; + + /** + * 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; + } + + /** {@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..9b94a611ec57f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.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 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; + + /** + * 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; + } + + /** {@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/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/MigrateSqlServerSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java index 3f66df0779b1b..3680a83f45933 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java @@ -23,13 +23,7 @@ @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbTaskOutputMigrationLevel.class), @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class), @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbTaskOutputTableLevel.class), - @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class), - @JsonSubTypes.Type( - name = "MigrationValidationOutput", - value = MigrateSqlServerSqlDbTaskOutputValidationResult.class), - @JsonSubTypes.Type( - name = "MigrationDatabaseLevelValidationOutput", - value = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.class) + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class) }) @Immutable public class MigrateSqlServerSqlDbTaskOutput { 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 deleted file mode 100644 index e07d45443b0c0..0000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java +++ /dev/null @@ -1,182 +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; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; - -/** Database validation result for Sql Server to Azure Sql DB migration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") -@JsonTypeName("MigrationDatabaseLevelValidationOutput") -@Immutable -public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult - extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.class); - - /* - * 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 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. - */ - @Override - public void validate() { - super.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/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/MigrateSqlServerSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java index 02739b1bac63e..f6ea33c7226e4 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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/MigrateSqlServerSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java index 701a543f25c67..96236ec604975 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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..e7e1c4f01e458 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 @@ -54,6 +54,14 @@ 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; + /** * Get the selectedDatabases property: Databases to migrate. * @@ -177,6 +185,28 @@ 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; + } + /** {@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..c89634d699cea 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") @@ -60,6 +61,13 @@ public List output() { return this.output; } + /** {@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..ddcce0912a606 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); /* 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/MigrateSqlServerSqlDbTaskOutputValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java similarity index 77% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java index 8715b6c44e8b0..afcc4542a5813 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/MigrationValidationResult.java @@ -8,17 +8,18 @@ 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.Map; -/** Validation result for Sql Server to Azure Sql DB migration. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") -@JsonTypeName("MigrationValidationOutput") +/** Migration Validation Result. */ @Fluent -public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends MigrateSqlServerSqlDbTaskOutput { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputValidationResult.class); +public final 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 @@ -39,6 +40,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. * @@ -61,9 +71,9 @@ public Map summaryResults() { * Set the summaryResults property: Validation summary results for each database. * * @param summaryResults the summaryResults value to set. - * @return the MigrateSqlServerSqlDbTaskOutputValidationResult object itself. + * @return the MigrationValidationResult object itself. */ - public MigrateSqlServerSqlDbTaskOutputValidationResult withSummaryResults( + public MigrationValidationResult withSummaryResults( Map summaryResults) { this.summaryResults = summaryResults; return this; @@ -84,9 +94,7 @@ public ValidationStatus status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { - super.validate(); if (summaryResults() != null) { summaryResults() .values() 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..73ffdf3cf8ad8 --- /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.Immutable; +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") +@Immutable +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..cefdf49bcbceb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.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 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; + + /** + * 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; + } + + /** {@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..be287a6fbd86e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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") + 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..6f4e8cc222003 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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) + 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..f8ff1cd55c17d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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") + 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..f90d1533bd406 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights 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.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) + 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..4984f75e00285 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights 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; +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) + 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..68a7af1a2ff49 --- /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", 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 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/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..3f958d1766177 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 @@ -36,6 +36,18 @@ 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; + /** * Get the serverName property: Name of the server. * @@ -96,6 +108,46 @@ 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; + } + /** {@inheritDoc} */ @Override public PostgreSqlConnectionInfo withUsername(String username) { 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..adfa7d06d37b7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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 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. + */ + 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. + */ + 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. + */ + 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..3e44d3a97c8dd 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,17 @@ 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.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. @@ -25,6 +27,11 @@ @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,19 @@ @JsonSubTypes.Type( name = "ConnectToSource.PostgreSql.Sync", value = ConnectToSourcePostgreSqlSyncTaskProperties.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 = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), @JsonSubTypes.Type( name = "ConnectToTarget.AzureSqlDbMI.Sync.LRS", @@ -46,6 +59,7 @@ @JsonSubTypes.Type( name = "ConnectToTarget.AzureDbForMySql", value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), @JsonSubTypes.Type( name = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", @@ -58,8 +72,11 @@ name = "Migrate.MySql.AzureDbForMySql.Sync", value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), @JsonSubTypes.Type( - name = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync", + 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 +86,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 +113,13 @@ 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") + private Map clientData; /** * Get the errors property: Array of errors. This is ignored if submitted. @@ -116,10 +144,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..b1c53ab3ae139 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 @@ -21,7 +21,7 @@ public interface Projects { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return oData page of project resources. */ - 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 @@ -35,7 +35,7 @@ public interface Projects { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return oData page of project resources. */ - 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 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/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/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..a76159c5fd74a 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 @@ -18,13 +18,13 @@ 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; /* @@ -48,6 +48,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 +69,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..b07e389982e11 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights 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; + + /** + * 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; + } + + /** + * 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/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/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..13d6527081d41 --- /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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 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. + */ + 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. + */ + 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..9db90d592e73e 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 @@ -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); /** @@ -210,7 +210,7 @@ NameAvailabilityResponse nestedCheckNameAvailability( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return indicates whether a proposed resource name is available. */ - Response nestedCheckNameAvailabilityWithResponse( + Response checkChildrenNameAvailabilityWithResponse( String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); /** 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/Tasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java index 9559990f1e376..a2ae24fd63863 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 { @@ -145,6 +146,46 @@ Response deleteWithResponse( 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. + */ + 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. 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/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/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