From cc5cc2705f2f619501ac127fd967e7860a7ad483 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 30 Apr 2025 16:42:54 +0000 Subject: [PATCH] CodeGen from PR 34371 in Azure/azure-rest-api-specs Merge 5a991e1ddde01c1ad3021a5d06676272f2ac00f5 into 37e1a52a30c527b6ad2d7ef09a9c82ad4491e8a2 --- .../CHANGELOG.md | 987 ++++++- .../README.md | 8 +- .../SAMPLE.md | 2510 +++++++++++++++-- .../pom.xml | 4 +- .../datamigration/DataMigrationManager.java | 173 +- .../fluent/DataMigrationManagementClient.java | 71 +- ...rationsMongoToCosmosDbRUMongoesClient.java | 221 ++ ...ionsMongoToCosmosDbvCoreMongoesClient.java | 221 ++ .../DatabaseMigrationsSqlDbsClient.java | 263 ++ .../DatabaseMigrationsSqlMisClient.java | 264 ++ .../DatabaseMigrationsSqlVmsClient.java | 264 ++ .../datamigration/fluent/FilesClient.java | 276 ++ .../fluent/MigrationServicesClient.java | 319 +++ .../fluent/OperationsClient.java | 18 +- .../datamigration/fluent/ProjectsClient.java | 4 +- .../fluent/ResourceSkusClient.java | 8 +- .../fluent/ServiceTasksClient.java | 242 ++ .../datamigration/fluent/ServicesClient.java | 216 +- .../fluent/SqlMigrationServicesClient.java | 450 +++ .../datamigration/fluent/TasksClient.java | 102 +- .../datamigration/fluent/UsagesClient.java | 6 +- .../models/AuthenticationKeysInner.java | 121 + .../fluent/models/CommandPropertiesInner.java | 180 ++ .../models/DataMigrationServiceInner.java | 93 +- .../DataMigrationServiceProperties.java | 106 +- ...taMigrationServiceStatusResponseInner.java | 28 + .../models/DatabaseMigrationBaseInner.java | 167 ++ .../DatabaseMigrationCosmosDbMongoInner.java | 168 ++ .../fluent/models/DatabaseMigrationInner.java | 166 ++ .../models/DatabaseMigrationSqlDbInner.java | 170 ++ .../models/DatabaseMigrationSqlMiInner.java | 170 ++ .../models/DatabaseMigrationSqlVmInner.java | 170 ++ .../fluent/models/DeleteNodeInner.java | 121 + .../fluent/models/FileStorageInfoInner.java | 123 + ...IntegrationRuntimeMonitoringDataInner.java | 105 + .../fluent/models/MigrationServiceInner.java | 199 ++ .../models/MigrationServiceProperties.java | 99 + .../models/NameAvailabilityResponseInner.java | 40 +- .../models/OperationsDefinitionInner.java | 164 ++ .../fluent/models/ProjectFileInner.java | 197 ++ .../fluent/models/ProjectInner.java | 74 + .../fluent/models/ProjectProperties.java | 34 + .../fluent/models/ProjectTaskInner.java | 20 + .../fluent/models/RegenAuthKeysInner.java | 149 + .../fluent/models/ResourceSkuInner.java | 6 +- .../fluent/models/ServiceOperationInner.java | 125 - .../models/SqlMigrationServiceInner.java | 202 ++ .../models/SqlMigrationServiceProperties.java | 98 + ...nImpl.java => AuthenticationKeysImpl.java} | 21 +- .../implementation/CommandPropertiesImpl.java | 50 + .../DataMigrationManagementClientBuilder.java | 4 +- .../DataMigrationManagementClientImpl.java | 168 +- .../DataMigrationServiceImpl.java | 40 +- ...ataMigrationServiceStatusResponseImpl.java | 4 + .../DatabaseMigrationBaseImpl.java | 50 + .../DatabaseMigrationCosmosDbMongoImpl.java | 107 + .../implementation/DatabaseMigrationImpl.java | 50 + .../DatabaseMigrationSqlDbImpl.java | 149 + .../DatabaseMigrationSqlMiImpl.java | 160 ++ .../DatabaseMigrationSqlVmImpl.java | 160 ++ ...onsMongoToCosmosDbRUMongoesClientImpl.java | 1037 +++++++ ...igrationsMongoToCosmosDbRUMongoesImpl.java | 167 ++ ...MongoToCosmosDbvCoreMongoesClientImpl.java | 1037 +++++++ ...ationsMongoToCosmosDbvCoreMongoesImpl.java | 110 + .../DatabaseMigrationsSqlDbsClientImpl.java | 1092 +++++++ .../DatabaseMigrationsSqlDbsImpl.java | 167 ++ .../DatabaseMigrationsSqlMisClientImpl.java | 1058 +++++++ .../DatabaseMigrationsSqlMisImpl.java | 130 + .../DatabaseMigrationsSqlVmsClientImpl.java | 1062 +++++++ .../DatabaseMigrationsSqlVmsImpl.java | 130 + .../implementation/DeleteNodeImpl.java | 36 + .../implementation/FileStorageInfoImpl.java | 43 + .../implementation/FilesClientImpl.java | 1299 +++++++++ .../implementation/FilesImpl.java | 221 ++ .../IntegrationRuntimeMonitoringDataImpl.java | 44 + .../implementation/MigrationServiceImpl.java | 177 ++ .../MigrationServicesClientImpl.java | 1551 ++++++++++ .../implementation/MigrationServicesImpl.java | 162 ++ .../implementation/OperationsClientImpl.java | 68 +- .../OperationsDefinitionImpl.java | 57 + .../implementation/OperationsImpl.java | 16 +- .../implementation/ProjectFileImpl.java | 164 ++ .../implementation/ProjectImpl.java | 24 + .../implementation/ProjectTaskImpl.java | 16 + .../implementation/ProjectsClientImpl.java | 47 +- .../implementation/ProjectsImpl.java | 8 +- .../implementation/RegenAuthKeysImpl.java | 40 + .../ResourceSkusClientImpl.java | 36 +- .../ServiceTasksClientImpl.java | 1138 ++++++++ .../implementation/ServiceTasksImpl.java | 141 + .../implementation/ServicesClientImpl.java | 605 ++-- .../implementation/ServicesImpl.java | 10 +- .../SqlMigrationServiceImpl.java | 221 ++ .../SqlMigrationServicesClientImpl.java | 2156 ++++++++++++++ .../SqlMigrationServicesImpl.java | 259 ++ .../implementation/TasksClientImpl.java | 347 ++- .../implementation/TasksImpl.java | 25 + .../implementation/UsagesClientImpl.java | 18 +- .../datamigration/models/AuthType.java | 56 + .../models/AuthenticationKeys.java | 33 + .../models/AvailableServiceSkuSku.java | 6 +- .../models/AzureActiveDirectoryApp.java | 47 +- .../datamigration/models/AzureBlob.java | 208 ++ .../models/BackupConfiguration.java | 127 + .../datamigration/models/BlobShare.java | 8 - .../models/CheckOciDriverTaskInput.java | 93 + .../models/CheckOciDriverTaskOutput.java | 118 + .../models/CheckOciDriverTaskProperties.java | 164 ++ .../models/CommandProperties.java | 149 +- .../datamigration/models/CommandType.java | 67 + .../ConnectToMongoDbTaskProperties.java | 164 ++ .../models/ConnectToSourceMySqlTaskInput.java | 29 + .../ConnectToSourceMySqlTaskProperties.java | 26 +- .../ConnectToSourceNonSqlTaskOutput.java | 2 +- .../ConnectToSourceOracleSyncTaskInput.java | 106 + .../ConnectToSourceOracleSyncTaskOutput.java | 138 + ...nnectToSourceOracleSyncTaskProperties.java | 168 ++ ...tToSourcePostgreSqlSyncTaskProperties.java | 27 +- ...ctToSourceSqlServerSyncTaskProperties.java | 27 +- .../ConnectToSourceSqlServerTaskInput.java | 117 + ...ourceSqlServerTaskOutputAgentJobLevel.java | 44 +- ...tToSourceSqlServerTaskOutputTaskLevel.java | 18 + ...onnectToSourceSqlServerTaskProperties.java | 55 +- ...nnectToTargetAzureDbForMySqlTaskInput.java | 29 + ...ToTargetAzureDbForMySqlTaskProperties.java | 27 +- ...zureDbForPostgreSqlSyncTaskProperties.java | 27 +- ...acleAzureDbForPostgreSqlSyncTaskInput.java | 111 + ...cleAzureDbForPostgreSqlSyncTaskOutput.java | 181 ++ ...qlSyncTaskOutputDatabaseSchemaMapItem.java | 131 + ...zureDbForPostgreSqlSyncTaskProperties.java | 172 ++ ...onnectToTargetSqlDbSyncTaskProperties.java | 27 +- .../models/ConnectToTargetSqlDbTaskInput.java | 31 + .../ConnectToTargetSqlDbTaskProperties.java | 54 +- .../ConnectToTargetSqlMISyncTaskInput.java | 12 +- ...onnectToTargetSqlMISyncTaskProperties.java | 27 +- .../models/ConnectToTargetSqlMITaskInput.java | 89 + .../ConnectToTargetSqlMITaskProperties.java | 26 +- .../datamigration/models/ConnectionInfo.java | 6 +- .../models/CopyProgressDetails.java | 244 ++ .../datamigration/models/CreatedByType.java | 61 + .../models/DataIntegrityValidationResult.java | 28 +- .../models/DataMigrationService.java | 153 +- .../DataMigrationServiceStatusResponse.java | 7 + .../models/DatabaseMigration.java | 55 + .../models/DatabaseMigrationBase.java | 55 + .../DatabaseMigrationBaseListResult.java | 105 + .../DatabaseMigrationBaseProperties.java | 374 +++ .../DatabaseMigrationCosmosDbMongo.java | 138 + ...abaseMigrationCosmosDbMongoListResult.java | 106 + .../models/DatabaseMigrationListResult.java | 104 + .../models/DatabaseMigrationProperties.java | 292 ++ ...abaseMigrationPropertiesCosmosDbMongo.java | 252 ++ .../DatabaseMigrationPropertiesSqlDb.java | 293 ++ .../DatabaseMigrationPropertiesSqlMi.java | 275 ++ .../DatabaseMigrationPropertiesSqlVm.java | 275 ++ .../models/DatabaseMigrationSqlDb.java | 210 ++ .../models/DatabaseMigrationSqlMi.java | 231 ++ .../models/DatabaseMigrationSqlVm.java | 231 ++ ...aseMigrationsMongoToCosmosDbRUMongoes.java | 156 + ...MigrationsMongoToCosmosDbvCoreMongoes.java | 136 + .../models/DatabaseMigrationsSqlDbs.java | 168 ++ .../models/DatabaseMigrationsSqlMis.java | 146 + .../models/DatabaseMigrationsSqlVms.java | 146 + .../datamigration/models/DatabaseTable.java | 97 + .../datamigration/models/DeleteNode.java | 33 + .../datamigration/models/ErrorInfo.java | 97 + .../models/ExecutionStatistics.java | 60 + ...erviceOperationList.java => FileList.java} | 55 +- .../datamigration/models/FileStorageInfo.java | 34 + .../datamigration/models/Files.java | 247 ++ .../GetTdeCertificatesSqlTaskProperties.java | 26 +- .../models/GetUserTablesMySqlTaskInput.java | 140 + .../models/GetUserTablesMySqlTaskOutput.java | 119 + .../GetUserTablesMySqlTaskProperties.java | 165 ++ .../models/GetUserTablesOracleTaskInput.java | 140 + .../models/GetUserTablesOracleTaskOutput.java | 124 + .../GetUserTablesOracleTaskProperties.java | 165 ++ .../GetUserTablesPostgreSqlTaskInput.java | 142 + .../GetUserTablesPostgreSqlTaskOutput.java | 124 + ...GetUserTablesPostgreSqlTaskProperties.java | 168 ++ .../GetUserTablesSqlSyncTaskProperties.java | 26 +- .../models/GetUserTablesSqlTaskInput.java | 28 + .../GetUserTablesSqlTaskProperties.java | 54 +- .../models/InstallOciDriverTaskInput.java | 93 + .../models/InstallOciDriverTaskOutput.java | 87 + .../InstallOciDriverTaskProperties.java | 165 ++ .../IntegrationRuntimeMonitoringData.java | 35 + .../models/ManagedServiceIdentity.java | 190 ++ .../models/ManagedServiceIdentityType.java | 62 + ...igrateMISyncCompleteCommandProperties.java | 48 +- .../models/MigrateMongoDbTaskProperties.java | 163 ++ ...qlAzureDbForMySqlOfflineDatabaseInput.java | 155 + ...eMySqlAzureDbForMySqlOfflineTaskInput.java | 312 ++ ...MySqlAzureDbForMySqlOfflineTaskOutput.java | 143 + ...orMySqlOfflineTaskOutputDatabaseLevel.java | 352 +++ ...AzureDbForMySqlOfflineTaskOutputError.java | 107 + ...rMySqlOfflineTaskOutputMigrationLevel.java | 382 +++ ...DbForMySqlOfflineTaskOutputTableLevel.java | 258 ++ ...lAzureDbForMySqlOfflineTaskProperties.java | 226 ++ ...MySqlAzureDbForMySqlSyncDatabaseInput.java | 29 + ...ySqlAzureDbForMySqlSyncTaskProperties.java | 27 +- ...zureDbForPostgreSqlSyncTaskProperties.java | 170 ++ ...cleAzureDbPostgreSqlSyncDatabaseInput.java | 299 ++ ...eOracleAzureDbPostgreSqlSyncTaskInput.java | 185 ++ ...OracleAzureDbPostgreSqlSyncTaskOutput.java | 145 + ...PostgreSqlSyncTaskOutputDatabaseError.java | 154 + ...PostgreSqlSyncTaskOutputDatabaseLevel.java | 347 +++ ...eAzureDbPostgreSqlSyncTaskOutputError.java | 107 + ...ostgreSqlSyncTaskOutputMigrationLevel.java | 194 ++ ...eDbPostgreSqlSyncTaskOutputTableLevel.java | 310 ++ ...AzureDbForPostgreSqlSyncDatabaseInput.java | 62 +- ...DbForPostgreSqlSyncDatabaseTableInput.java | 97 + ...eSqlAzureDbForPostgreSqlSyncTaskInput.java | 49 + ...ureDbForPostgreSqlSyncTaskOutputError.java | 39 +- ...ostgreSqlSyncTaskOutputMigrationLevel.java | 84 +- ...zureDbForPostgreSqlSyncTaskProperties.java | 112 +- ...rateSchemaSqlServerSqlDbDatabaseInput.java | 183 ++ .../MigrateSchemaSqlServerSqlDbTaskInput.java | 206 ++ ...MigrateSchemaSqlServerSqlDbTaskOutput.java | 141 + ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 257 ++ ...teSchemaSqlServerSqlDbTaskOutputError.java | 118 + ...qlServerSqlDbTaskOutputMigrationLevel.java | 208 ++ ...ateSchemaSqlServerSqlDbTaskProperties.java | 253 ++ .../MigrateSchemaSqlTaskOutputError.java | 105 + .../MigrateSqlServerSqlDbDatabaseInput.java | 56 + ...grateSqlServerSqlDbSyncTaskProperties.java | 27 +- .../MigrateSqlServerSqlDbTaskInput.java | 56 + ...SqlServerSqlDbTaskOutputDatabaseLevel.java | 2 +- ...skOutputDatabaseLevelValidationResult.java | 23 +- .../MigrateSqlServerSqlDbTaskOutputError.java | 2 +- ...qlServerSqlDbTaskOutputMigrationLevel.java | 73 +- ...ateSqlServerSqlDbTaskOutputTableLevel.java | 2 +- ...ServerSqlDbTaskOutputValidationResult.java | 23 +- .../MigrateSqlServerSqlDbTaskProperties.java | 111 +- .../MigrateSqlServerSqlMIDatabaseInput.java | 28 + .../MigrateSqlServerSqlMISyncTaskInput.java | 30 + ...grateSqlServerSqlMISyncTaskProperties.java | 55 +- .../MigrateSqlServerSqlMITaskInput.java | 87 + .../MigrateSqlServerSqlMITaskProperties.java | 139 +- .../models/MigrateSsisTaskInput.java | 142 + .../models/MigrateSsisTaskOutput.java | 136 + .../MigrateSsisTaskOutputMigrationLevel.java | 258 ++ .../MigrateSsisTaskOutputProjectLevel.java | 225 ++ .../models/MigrateSsisTaskProperties.java | 164 ++ .../MigrateSyncCompleteCommandProperties.java | 76 +- .../models/MigrationOperationInput.java | 96 + .../models/MigrationReportResult.java | 28 +- .../models/MigrationService.java | 247 ++ .../models/MigrationServiceListResult.java | 104 + .../models/MigrationServiceUpdate.java | 95 + .../models/MigrationServices.java | 192 ++ .../models/MigrationStatusDetails.java | 288 ++ ...igrationValidationDatabaseLevelResult.java | 361 +++ .../models/MigrationValidationResult.java | 188 ++ .../models/MongoConnectionInformation.java | 233 ++ .../models/MongoDbCancelCommand.java | 152 + .../models/MongoDbClusterInfo.java | 200 ++ .../models/MongoDbClusterType.java | 56 + .../models/MongoDbCollectionInfo.java | 347 +++ .../models/MongoDbCollectionProgress.java | 275 ++ .../models/MongoDbCollectionSettings.java | 158 ++ .../models/MongoDbCommandInput.java | 95 + .../models/MongoDbConnectionInfo.java | 430 +++ .../models/MongoDbDatabaseInfo.java | 207 ++ .../models/MongoDbDatabaseProgress.java | 311 ++ .../models/MongoDbDatabaseSettings.java | 145 + .../datamigration/models/MongoDbError.java | 177 ++ .../models/MongoDbErrorType.java | 56 + .../models/MongoDbFinishCommand.java | 152 + .../models/MongoDbFinishCommandInput.java | 109 + .../models/MongoDbMigrationProgress.java | 313 ++ .../models/MongoDbMigrationSettings.java | 279 ++ .../models/MongoDbMigrationState.java | 96 + .../models/MongoDbObjectInfo.java | 220 ++ .../datamigration/models/MongoDbProgress.java | 524 ++++ .../models/MongoDbProgressResultType.java | 56 + .../models/MongoDbReplication.java | 56 + .../models/MongoDbRestartCommand.java | 152 + .../models/MongoDbShardKeyField.java | 133 + .../models/MongoDbShardKeyInfo.java | 134 + .../models/MongoDbShardKeyOrder.java | 56 + .../models/MongoDbShardKeySetting.java | 134 + .../models/MongoDbThrottlingSettings.java | 151 + .../models/MongoMigrationCollection.java | 197 ++ .../models/MongoMigrationProgressDetails.java | 150 + .../models/MongoMigrationStatus.java | 66 + .../models/MySqlConnectionInfo.java | 113 + .../models/NodeMonitoringData.java | 211 ++ .../models/OfflineConfiguration.java | 126 + .../models/OperationListResult.java | 104 + .../datamigration/models/OperationOrigin.java | 51 + .../datamigration/models/Operations.java | 16 +- .../models/OperationsDefinition.java | 55 + .../models/OperationsDisplayDefinition.java | 129 + .../models/OracleConnectionInfo.java | 257 ++ .../models/OracleOciDriverInfo.java | 164 ++ .../models/PostgreSqlConnectionInfo.java | 199 ++ .../datamigration/models/Project.java | 84 +- .../datamigration/models/ProjectFile.java | 271 ++ .../models/ProjectFileProperties.java | 189 ++ .../models/ProjectSourcePlatform.java | 15 + .../models/ProjectTargetPlatform.java | 20 + .../datamigration/models/ProjectTask.java | 45 +- .../models/ProjectTaskProperties.java | 93 +- .../datamigration/models/Projects.java | 4 +- .../models/ProvisioningState.java | 67 + .../models/QueryAnalysisValidationResult.java | 28 +- .../models/QueryExecutionResult.java | 52 +- .../datamigration/models/RegenAuthKeys.java | 40 + .../models/ReplicateMigrationState.java | 71 + .../models/ReportableException.java | 60 + .../datamigration/models/ResourceSku.java | 2 +- .../datamigration/models/ResourceSkus.java | 8 +- .../models/ResourceSkusResult.java | 13 +- .../datamigration/models/ResourceType.java | 61 + .../datamigration/models/ScenarioSource.java | 96 + .../datamigration/models/ScenarioTarget.java | 76 + .../SchemaComparisonValidationResult.java | 25 + .../SchemaComparisonValidationResultType.java | 40 +- .../models/SchemaMigrationOption.java | 56 + .../models/SchemaMigrationSetting.java | 150 + .../models/SchemaMigrationStage.java | 91 + .../models/ServerLevelPermissionsGroup.java | 7 +- .../models/ServerProperties.java | 2 +- .../models/ServiceOperation.java | 33 - .../models/ServiceOperationDisplay.java | 177 -- .../datamigration/models/ServiceSku.java | 6 +- .../datamigration/models/ServiceTasks.java | 227 ++ .../datamigration/models/Services.java | 112 +- .../datamigration/models/SourceLocation.java | 143 + .../models/SqlBackupFileInfo.java | 193 ++ .../models/SqlBackupSetInfo.java | 254 ++ .../models/SqlConnectionInfo.java | 140 + .../models/SqlConnectionInformation.java | 234 ++ .../models/SqlDbMigrationStatusDetails.java | 120 + .../models/SqlDbOfflineConfiguration.java | 81 + .../datamigration/models/SqlFileShare.java | 149 + .../models/SqlMigrationListResult.java | 104 + .../models/SqlMigrationService.java | 337 +++ .../models/SqlMigrationServiceUpdate.java | 95 + .../models/SqlMigrationServices.java | 313 ++ .../models/SqlServerSqlMISyncTaskInput.java | 12 +- .../models/SsisMigrationInfo.java | 155 + .../models/SsisMigrationOverwriteOption.java | 52 + .../models/SsisMigrationStage.java | 61 + .../datamigration/models/SsisStoreType.java | 46 + .../SyncDatabaseMigrationReportingState.java | 35 + .../models/SystemDataAutoGenerated.java | 242 ++ .../datamigration/models/TargetLocation.java | 121 + .../datamigration/models/TaskType.java | 242 ++ .../datamigration/models/Tasks.java | 92 +- .../models/UploadOciDriverTaskInput.java | 96 + .../models/UploadOciDriverTaskOutput.java | 103 + .../models/UploadOciDriverTaskProperties.java | 165 ++ .../datamigration/models/Usages.java | 6 +- .../models/UserAssignedIdentity.java | 100 + ...InputSqlServerSqlDbSyncTaskProperties.java | 27 +- ...InputSqlServerSqlMISyncTaskProperties.java | 27 +- ...tionInputSqlServerSqlMITaskProperties.java | 27 +- .../models/ValidateMongoDbTaskProperties.java | 165 ++ ...zureDbForPostgreSqlSyncTaskProperties.java | 172 ++ ...OracleAzureDbPostgreSqlSyncTaskOutput.java | 89 + .../datamigration/models/ValidationError.java | 28 +- .../models/ValidationStatus.java | 8 +- .../datamigration/models/WaitStatistics.java | 40 +- .../proxy-config.json | 2 +- .../reflect-config.json | 2 +- ...e-resourcemanager-datamigration.properties | 1 + ...nsMongoToCosmosDbRUMongoCreateSamples.java | 91 + ...nsMongoToCosmosDbRUMongoDeleteSamples.java | 26 + ...goToCosmosDbRUMongoGetForScopeSamples.java | 42 + ...tionsMongoToCosmosDbRUMongoGetSamples.java | 44 + ...ongoToCosmosDbvCoreMongoCreateSamples.java | 91 + ...ongoToCosmosDbvCoreMongoDeleteSamples.java | 26 + ...oCosmosDbvCoreMongoGetForScopeSamples.java | 42 + ...nsMongoToCosmosDbvCoreMongoGetSamples.java | 44 + .../DatabaseMigrationsSqlDbCancelSamples.java | 30 + ...eMigrationsSqlDbCreateOrUpdateSamples.java | 85 + .../DatabaseMigrationsSqlDbDeleteSamples.java | 26 + .../DatabaseMigrationsSqlDbGetSamples.java | 43 + .../DatabaseMigrationsSqlMiCancelSamples.java | 30 + ...eMigrationsSqlMiCreateOrUpdateSamples.java | 147 + ...DatabaseMigrationsSqlMiCutoverSamples.java | 30 + .../DatabaseMigrationsSqlMiGetSamples.java | 43 + .../DatabaseMigrationsSqlVmCancelSamples.java | 30 + ...eMigrationsSqlVmCreateOrUpdateSamples.java | 94 + ...DatabaseMigrationsSqlVmCutoverSamples.java | 30 + .../DatabaseMigrationsSqlVmGetSamples.java | 43 + .../generated/FilesCreateOrUpdateSamples.java | 30 + .../generated/FilesDeleteSamples.java | 26 + .../generated/FilesGetSamples.java | 26 + .../generated/FilesListSamples.java | 24 + .../generated/FilesReadSamples.java | 26 + .../generated/FilesReadWriteSamples.java | 26 + .../generated/FilesUpdateSamples.java | 33 + ...igrationServicesCreateOrUpdateSamples.java | 48 + .../MigrationServicesDeleteSamples.java | 24 + ...tionServicesGetByResourceGroupSamples.java | 25 + ...ionServicesListByResourceGroupSamples.java | 25 + ...igrationServicesListMigrationsSamples.java | 25 + .../MigrationServicesListSamples.java | 25 + .../MigrationServicesUpdateSamples.java | 43 + .../generated/OperationsListSamples.java | 9 +- .../ProjectsCreateOrUpdateSamples.java | 2 +- .../generated/ProjectsDeleteSamples.java | 4 +- .../generated/ProjectsGetSamples.java | 3 +- ...pSamples.java => ProjectsListSamples.java} | 15 +- .../generated/ProjectsUpdateSamples.java | 4 +- .../generated/ResourceSkusListSamples.java | 2 +- .../generated/ServiceTasksCancelSamples.java | 25 + .../ServiceTasksCreateOrUpdateSamples.java | 33 + .../generated/ServiceTasksDeleteSamples.java | 25 + .../generated/ServiceTasksGetSamples.java | 25 + .../generated/ServiceTasksListSamples.java | 24 + .../generated/ServiceTasksUpdateSamples.java | 33 + ...sCheckChildrenNameAvailabilitySamples.java | 29 + .../ServicesCheckNameAvailabilitySamples.java | 5 +- .../generated/ServicesCheckStatusSamples.java | 2 +- .../ServicesCreateOrUpdateSamples.java | 2 +- .../generated/ServicesDeleteSamples.java | 4 +- .../ServicesGetByResourceGroupSamples.java | 3 +- .../ServicesListByResourceGroupSamples.java | 2 +- .../generated/ServicesListSamples.java | 4 +- .../generated/ServicesListSkusSamples.java | 4 +- ...cesNestedCheckNameAvailabilitySamples.java | 29 - .../generated/ServicesStartSamples.java | 4 +- .../generated/ServicesStopSamples.java | 4 +- .../generated/ServicesUpdateSamples.java | 4 +- ...igrationServicesCreateOrUpdateSamples.java | 48 + ...SqlMigrationServicesDeleteNodeSamples.java | 30 + .../SqlMigrationServicesDeleteSamples.java | 24 + ...tionServicesGetByResourceGroupSamples.java | 25 + ...lMigrationServicesListAuthKeysSamples.java | 25 + ...ionServicesListByResourceGroupSamples.java | 25 + ...igrationServicesListMigrationsSamples.java | 25 + ...tionServicesListMonitoringDataSamples.java | 25 + .../SqlMigrationServicesListSamples.java | 25 + ...tionServicesRegenerateAuthKeysSamples.java | 29 + .../SqlMigrationServicesUpdateSamples.java | 43 + .../generated/TasksCancelSamples.java | 3 +- .../generated/TasksCommandSamples.java | 31 + .../generated/TasksCreateOrUpdateSamples.java | 2 +- .../generated/TasksDeleteSamples.java | 3 +- .../generated/TasksGetSamples.java | 3 +- .../generated/TasksListSamples.java | 3 +- .../generated/TasksUpdateSamples.java | 3 +- .../generated/UsagesListSamples.java | 3 +- .../AvailableServiceSkuCapacityTests.java | 37 - .../AvailableServiceSkuInnerTests.java | 53 - .../AvailableServiceSkuSkuTests.java | 33 - .../generated/BackupFileInfoTests.java | 34 - .../generated/BackupSetInfoTests.java | 71 - .../generated/BlobShareTests.java | 24 - .../ConnectToSourceNonSqlTaskOutputTests.java | 23 - ...ToSourcePostgreSqlSyncTaskOutputTests.java | 23 - ...SqlServerTaskOutputAgentJobLevelTests.java | 23 - ...SqlServerTaskOutputDatabaseLevelTests.java | 23 - ...rceSqlServerTaskOutputLoginLevelTests.java | 23 - ...urceSqlServerTaskOutputTaskLevelTests.java | 23 - ...nnectToSourceSqlServerTaskOutputTests.java | 23 - ...oTargetAzureDbForMySqlTaskOutputTests.java | 23 - ...ureDbForPostgreSqlSyncTaskOutputTests.java | 24 - .../ConnectToTargetSqlDbTaskOutputTests.java | 23 - ...nnectToTargetSqlMISyncTaskOutputTests.java | 23 - .../ConnectToTargetSqlMITaskOutputTests.java | 23 - .../DataIntegrityValidationResultTests.java | 23 - .../DataItemMigrationSummaryResultTests.java | 23 - ...rationServiceStatusResponseInnerTests.java | 37 - .../generated/DatabaseBackupInfoTests.java | 23 - .../generated/DatabaseFileInfoTests.java | 45 - .../generated/DatabaseInfoTests.java | 25 - .../generated/DatabaseSummaryResultTests.java | 23 - .../generated/ExecutionStatisticsTests.java | 38 - .../GetUserTablesSqlSyncTaskOutputTests.java | 23 - .../GetUserTablesSqlTaskOutputTests.java | 23 - ...igrateMISyncCompleteCommandInputTests.java | 26 - ...grateMISyncCompleteCommandOutputTests.java | 31 - ...AzureDbForMySqlSyncDatabaseInputTests.java | 55 - ...MySqlSyncTaskOutputDatabaseErrorTests.java | 31 - ...MySqlSyncTaskOutputDatabaseLevelTests.java | 24 - ...ureDbForMySqlSyncTaskOutputErrorTests.java | 23 - ...ySqlSyncTaskOutputMigrationLevelTests.java | 24 - ...ForMySqlSyncTaskOutputTableLevelTests.java | 24 - ...SqlAzureDbForMySqlSyncTaskOutputTests.java | 23 - ...DbForPostgreSqlSyncDatabaseInputTests.java | 54 - ...reSqlSyncTaskOutputDatabaseErrorTests.java | 31 - ...reSqlSyncTaskOutputDatabaseLevelTests.java | 25 - ...ForPostgreSqlSyncTaskOutputErrorTests.java | 24 - ...eSqlSyncTaskOutputMigrationLevelTests.java | 25 - ...stgreSqlSyncTaskOutputTableLevelTests.java | 25 - ...ureDbForPostgreSqlSyncTaskOutputTests.java | 24 - ...grateSqlServerSqlDbDatabaseInputTests.java | 49 - ...eSqlServerSqlDbSyncDatabaseInputTests.java | 62 - ...SqlDbSyncTaskOutputDatabaseErrorTests.java | 31 - ...SqlDbSyncTaskOutputDatabaseLevelTests.java | 23 - ...qlServerSqlDbSyncTaskOutputErrorTests.java | 23 - ...qlDbSyncTaskOutputMigrationLevelTests.java | 24 - ...verSqlDbSyncTaskOutputTableLevelTests.java | 23 - ...rateSqlServerSqlDbSyncTaskOutputTests.java | 23 - ...rverSqlDbTaskOutputDatabaseLevelTests.java | 23 - ...putDatabaseLevelValidationResultTests.java | 25 - ...ateSqlServerSqlDbTaskOutputErrorTests.java | 23 - ...verSqlDbTaskOutputMigrationLevelTests.java | 23 - ...lServerSqlDbTaskOutputTableLevelTests.java | 23 - .../MigrateSqlServerSqlDbTaskOutputTests.java | 23 - ...rSqlDbTaskOutputValidationResultTests.java | 40 - ...SqlMISyncTaskOutputDatabaseLevelTests.java | 23 - ...qlServerSqlMISyncTaskOutputErrorTests.java | 23 - ...qlMISyncTaskOutputMigrationLevelTests.java | 24 - ...rateSqlServerSqlMISyncTaskOutputTests.java | 23 - ...rverSqlMITaskOutputAgentJobLevelTests.java | 23 - ...rverSqlMITaskOutputDatabaseLevelTests.java | 23 - ...ateSqlServerSqlMITaskOutputErrorTests.java | 23 - ...lServerSqlMITaskOutputLoginLevelTests.java | 23 - ...verSqlMITaskOutputMigrationLevelTests.java | 23 - .../MigrateSqlServerSqlMITaskOutputTests.java | 23 - .../MigrateSyncCompleteCommandInputTests.java | 30 - ...MigrateSyncCompleteCommandOutputTests.java | 23 - .../MigrationEligibilityInfoTests.java | 23 - .../generated/MigrationReportResultTests.java | 22 - ...nValidationDatabaseSummaryResultTests.java | 23 - .../MigrationValidationOptionsTests.java | 32 - .../NameAvailabilityRequestTests.java | 27 - .../NameAvailabilityResponseInnerTests.java | 23 - .../generated/OperationsListMockTests.java | 42 - .../generated/OrphanedUserInfoTests.java | 27 - .../ProjectsDeleteWithResponseMockTests.java | 34 - .../QueryAnalysisValidationResultTests.java | 23 - .../generated/QueryExecutionResultTests.java | 23 - .../generated/QuotaInnerTests.java | 41 - .../generated/QuotaListTests.java | 45 - .../generated/QuotaNameTests.java | 27 - .../generated/ReportableExceptionTests.java | 26 - .../ResourceSkuCapabilitiesTests.java | 22 - .../generated/ResourceSkuCapacityTests.java | 23 - .../generated/ResourceSkuCostsTests.java | 23 - ...SchemaComparisonValidationResultTests.java | 46 - ...maComparisonValidationResultTypeTests.java | 23 - .../generated/ServerPropertiesTests.java | 23 - .../ServiceOperationDisplayTests.java | 35 - .../generated/ServiceOperationInnerTests.java | 39 - .../generated/ServiceOperationListTests.java | 55 - .../generated/ServiceSkuListTests.java | 59 - .../generated/ServiceSkuTests.java | 38 - ...NameAvailabilityWithResponseMockTests.java | 38 - ...vicesCheckStatusWithResponseMockTests.java | 41 - .../generated/ServicesDeleteMockTests.java | 33 - .../generated/ServicesListSkusMockTests.java | 48 - ...NameAvailabilityWithResponseMockTests.java | 39 - .../generated/ServicesStartMockTests.java | 33 - .../generated/ServicesStopMockTests.java | 33 - .../SyncMigrationDatabaseErrorEventTests.java | 23 - .../TasksDeleteWithResponseMockTests.java | 34 - .../generated/UsagesListMockTests.java | 43 - ...nputSqlServerSqlMISyncTaskOutputTests.java | 24 - ...igrationInputSqlServerTaskOutputTests.java | 23 - .../generated/ValidationErrorTests.java | 22 - .../generated/WaitStatisticsTests.java | 23 - 558 files changed, 58952 insertions(+), 5204 deletions(-) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbRUMongoesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/MigrationServicesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationBaseInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationCosmosDbMongoInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/{ServiceOperationImpl.java => AuthenticationKeysImpl.java} (52%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationBaseImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationCosmosDbMongoImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServiceImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureBlob.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CreatedByType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBase.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongoListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesCosmosDbMongo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbRUMongoes.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbvCoreMongoes.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/{ServiceOperationList.java => FileList.java} (56%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentity.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentityType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationService.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceUpdate.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServices.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoConnectionInformation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationCollection.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationProgressDetails.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationStatus.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProvisioningState.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SystemDataAutoGenerated.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UserAssignedIdentity.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/azure-resourcemanager-datamigration.properties create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCutoverSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCutoverSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadWriteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesGetByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListMigrationsSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesUpdateSamples.java rename sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/{ProjectsListByResourceGroupSamples.java => ProjectsListSamples.java} (52%) create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCancelSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksGetSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckChildrenNameAvailabilitySamples.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilitySamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesCreateOrUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteNodeSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesGetByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListAuthKeysSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListByResourceGroupSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMigrationsSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMonitoringDataSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesRegenerateAuthKeysSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesUpdateSamples.java create mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuCapacityTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuInnerTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuSkuTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupFileInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupSetInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BlobShareTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceNonSqlTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourcePostgreSqlSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputAgentJobLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputLoginLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTaskLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForMySqlTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlDbTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMISyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMITaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataIntegrityValidationResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataItemMigrationSummaryResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataMigrationServiceStatusResponseInnerTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseBackupInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseFileInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseSummaryResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ExecutionStatisticsTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbDatabaseInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncDatabaseInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTableLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTableLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputValidationResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputAgentJobLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputDatabaseLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputLoginLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputMigrationLevelTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandInputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationEligibilityInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationReportResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationDatabaseSummaryResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationOptionsTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityRequestTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityResponseInnerTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OperationsListMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OrphanedUserInfoTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteWithResponseMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryAnalysisValidationResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryExecutionResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaInnerTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaListTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaNameTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ReportableExceptionTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapabilitiesTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapacityTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCostsTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTypeTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServerPropertiesTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationDisplayTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationInnerTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationListTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuListTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilityWithResponseMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusWithResponseMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilityWithResponseMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStartMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStopMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SyncMigrationDatabaseErrorEventTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteWithResponseMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/UsagesListMockTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateMigrationInputSqlServerSqlMISyncTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateSyncMigrationInputSqlServerTaskOutputTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidationErrorTests.java delete mode 100644 sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/WaitStatisticsTests.java diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md index 78b1b7d09dc3..59d62d01c3fe 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md +++ b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md @@ -1,14 +1,993 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-30) -### Features Added +- Azure Resource Manager DataMigration client library for Java. This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-preview-2025-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ServiceOperationList` was removed + +#### `models.ServiceOperation` was removed + +#### `models.ServiceOperationDisplay` was removed + +#### `models.ProjectTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.GetUserTablesSqlSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.GetUserTablesSqlTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToTargetSqlDbTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ValidateMigrationInputSqlServerSqlMISyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToSourcePostgreSqlSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToSourceSqlServerSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToTargetSqlMISyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateSqlServerSqlMITaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToTargetSqlMITaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.DataMigrationService` was modified + +* `nestedCheckNameAvailabilityWithResponse(models.NameAvailabilityRequest,com.azure.core.util.Context)` was removed +* `nestedCheckNameAvailability(models.NameAvailabilityRequest)` was removed + +#### `models.Projects` was modified + +* `listByResourceGroup(java.lang.String,java.lang.String)` was removed +* `listByResourceGroup(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.CommandProperties` was modified + +* `java.util.List errors()` -> `java.util.List errors()` +* `models.CommandState state()` -> `models.CommandState state()` +* `java.lang.String commandType()` -> `models.CommandType commandType()` +* `fromJson(com.azure.json.JsonReader)` was removed +* `toJson(com.azure.json.JsonWriter)` was removed +* `validate()` was removed + +#### `models.ValidateMigrationInputSqlServerSqlMITaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateSqlServerSqlDbTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.ConnectToTargetAzureDbForMySqlTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateSyncCompleteCommandProperties` was modified + +* `java.lang.String commandType()` -> `models.CommandType commandType()` + +#### `models.ConnectToTargetSqlDbSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.GetTdeCertificatesSqlTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateMISyncCompleteCommandProperties` was modified + +* `java.lang.String commandType()` -> `models.CommandType commandType()` + +#### `models.ConnectToSourceMySqlTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.Services` was modified + +* `nestedCheckNameAvailability(java.lang.String,java.lang.String,models.NameAvailabilityRequest)` was removed +* `nestedCheckNameAvailabilityWithResponse(java.lang.String,java.lang.String,models.NameAvailabilityRequest,com.azure.core.util.Context)` was removed + +#### `models.MigrateSqlServerSqlMISyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateSqlServerSqlDbTaskOutputMigrationLevel` was modified + +* `migrationReport()` was removed + +#### `models.ConnectToSourceSqlServerTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateMySqlAzureDbForMySqlSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +#### `models.MigrateSqlServerSqlDbSyncTaskProperties` was modified + +* `java.lang.String taskType()` -> `models.TaskType taskType()` + +### Features Added + +* `models.ScenarioTarget` was added + +* `models.OperationListResult` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskProperties` was added + +* `models.DeleteNode` was added + +* `models.DatabaseMigrationSqlMi$DefinitionStages` was added + +* `models.SqlDbMigrationStatusDetails` was added + +* `models.SqlBackupSetInfo` was added + +* `models.UploadOciDriverTaskInput` was added + +* `models.GetUserTablesMySqlTaskOutput` was added + +* `models.ReplicateMigrationState` was added + +* `models.UserAssignedIdentity` was added + +* `models.DatabaseMigrationSqlMi$Definition` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel` was added + +* `models.SqlMigrationService$UpdateStages` was added + +* `models.DatabaseMigrationsMongoToCosmosDbvCoreMongoes` was added + +* `models.MigrateSsisTaskOutput` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutput` was added + +* `models.DatabaseMigrationSqlVm$Update` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel` was added + +* `models.MigrationValidationResult` was added + +* `models.MongoDbReplication` was added + +* `models.MigrationServiceUpdate` was added + +* `models.DatabaseMigrationSqlDb$Update` was added + +* `models.MongoDbDatabaseInfo` was added + +* `models.DatabaseMigrationSqlMi$UpdateStages` was added + +* `models.DatabaseMigrationBaseProperties` was added + +* `models.ScenarioSource` was added + +* `models.InstallOciDriverTaskInput` was added + +* `models.ConnectToSourceOracleSyncTaskInput` was added + +* `models.DatabaseMigrationCosmosDbMongo` was added + +* `models.DatabaseMigration` was added + +* `models.MigrationService$Definition` was added + +* `models.DatabaseMigrationPropertiesSqlDb` was added + +* `models.GetUserTablesPostgreSqlTaskProperties` was added + +* `models.ProjectFileProperties` was added + +* `models.MongoDbShardKeySetting` was added + +* `models.BackupConfiguration` was added + +* `models.DatabaseMigrationSqlMi` was added + +* `models.CreatedByType` was added + +* `models.MongoDbThrottlingSettings` was added + +* `models.ProjectFile$Update` was added + +* `models.MigrationServices` was added + +* `models.SsisMigrationInfo` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskInput` was added + +* `models.ErrorInfo` was added + +* `models.MigrateSsisTaskOutputProjectLevel` was added + +* `models.MigrationValidationDatabaseLevelResult` was added + +* `models.DatabaseMigrationProperties` was added + +* `models.DatabaseMigrationsSqlDbs` was added + +* `models.MigrationOperationInput` was added + +* `models.ValidateOracleAzureDbForPostgreSqlSyncTaskProperties` was added + +* `models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput` was added + +* `models.SqlMigrationServices` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel` was added + +* `models.InstallOciDriverTaskProperties` was added + +* `models.MigrationStatusDetails` was added + +* `models.MigrateSsisTaskOutputMigrationLevel` was added + +* `models.DatabaseMigrationSqlVm$DefinitionStages` was added + +* `models.MigrationServiceListResult` was added + +* `models.ValidateMongoDbTaskProperties` was added + +* `models.MongoDbDatabaseProgress` was added + +* `models.MongoDbShardKeyInfo` was added + +* `models.ConnectToSourceOracleSyncTaskOutput` was added + +* `models.OperationsDisplayDefinition` was added + +* `models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties` was added + +* `models.MongoDbClusterInfo` was added + +* `models.DatabaseMigrationBase` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskInput` was added + +* `models.MongoDbMigrationProgress` was added + +* `models.MigrateOracleAzureDbForPostgreSqlSyncTaskProperties` was added + +* `models.MongoDbCollectionInfo` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput` was added + +* `models.ServiceTasks` was added + +* `models.UploadOciDriverTaskProperties` was added + +* `models.DatabaseMigrationBaseListResult` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel` was added + +* `models.CheckOciDriverTaskProperties` was added + +* `models.ProvisioningState` was added + +* `models.Files` was added + +* `models.GetUserTablesMySqlTaskInput` was added + +* `models.MongoDbProgress` was added + +* `models.ProjectFile$Definition` was added + +* `models.SqlBackupFileInfo` was added + +* `models.DatabaseMigrationSqlVm` was added + +* `models.SqlMigrationService$Update` was added + +* `models.SourceLocation` was added + +* `models.GetUserTablesPostgreSqlTaskInput` was added + +* `models.SqlDbOfflineConfiguration` was added + +* `models.RegenAuthKeys` was added + +* `models.MigrationService$Update` was added + +* `models.AzureBlob` was added + +* `models.DatabaseMigrationSqlVm$Definition` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskOutputError` was added + +* `models.MigrateSchemaSqlTaskOutputError` was added + +* `models.MongoDbDatabaseSettings` was added + +* `models.GetUserTablesPostgreSqlTaskOutput` was added + +* `models.MigrationService$UpdateStages` was added + +* `models.DatabaseMigrationSqlMi$Update` was added + +* `models.MongoMigrationCollection` was added + +* `models.OperationsDefinition` was added + +* `models.GetUserTablesMySqlTaskProperties` was added + +* `models.OperationOrigin` was added + +* `models.OfflineConfiguration` was added + +* `models.MongoDbFinishCommand` was added + +* `models.DatabaseMigrationsSqlMis` was added + +* `models.MongoDbCollectionSettings` was added + +* `models.MongoMigrationProgressDetails` was added + +* `models.MigrateSsisTaskInput` was added + +* `models.SsisStoreType` was added + +* `models.MongoDbMigrationSettings` was added + +* `models.DatabaseMigrationCosmosDbMongo$Definition` was added + +* `models.MigrationService` was added + +* `models.InstallOciDriverTaskOutput` was added + +* `models.DatabaseMigrationListResult` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskOutput` was added + +* `models.MongoDbShardKeyField` was added + +* `models.FileStorageInfo` was added + +* `models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError` was added + +* `models.IntegrationRuntimeMonitoringData` was added + +* `models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem` was added + +* `models.OracleOciDriverInfo` was added + +* `models.GetUserTablesOracleTaskProperties` was added + +* `models.TaskType` was added + +* `models.MongoDbError` was added + +* `models.NodeMonitoringData` was added + +* `models.DatabaseMigrationPropertiesCosmosDbMongo` was added + +* `models.ConnectToSourceOracleSyncTaskProperties` was added + +* `models.ProjectFile$UpdateStages` was added + +* `models.SqlMigrationServiceUpdate` was added + +* `models.UploadOciDriverTaskOutput` was added + +* `models.DatabaseTable` was added + +* `models.ProjectFile` was added + +* `models.SqlFileShare` was added + +* `models.GetUserTablesOracleTaskInput` was added + +* `models.MongoDbFinishCommandInput` was added + +* `models.MigrateSchemaSqlServerSqlDbTaskOutput` was added + +* `models.CommandType` was added + +* `models.MongoDbCancelCommand` was added + +* `models.SqlConnectionInformation` was added + +* `models.MongoDbCollectionProgress` was added + +* `models.MigrateMongoDbTaskProperties` was added + +* `models.MigrationService$DefinitionStages` was added + +* `models.DatabaseMigrationPropertiesSqlVm` was added + +* `models.ConnectToMongoDbTaskProperties` was added + +* `models.SchemaMigrationSetting` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel` was added + +* `models.MongoDbConnectionInfo` was added + +* `models.CheckOciDriverTaskInput` was added + +* `models.AuthType` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel` was added + +* `models.MongoDbClusterType` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel` was added + +* `models.FileList` was added + +* `models.MigrateSsisTaskProperties` was added + +* `models.SchemaMigrationStage` was added + +* `models.ProjectFile$DefinitionStages` was added + +* `models.DatabaseMigrationSqlVm$UpdateStages` was added + +* `models.SqlMigrationService$Definition` was added + +* `models.ManagedServiceIdentity` was added + +* `models.SqlMigrationService$DefinitionStages` was added + +* `models.ResourceType` was added + +* `models.MongoMigrationStatus` was added + +* `models.MongoDbErrorType` was added + +* `models.SsisMigrationOverwriteOption` was added + +* `models.MongoConnectionInformation` was added + +* `models.MigrateSchemaSqlServerSqlDbDatabaseInput` was added + +* `models.SqlMigrationListResult` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput` was added + +* `models.MongoDbCommandInput` was added + +* `models.SqlMigrationService` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel` was added + +* `models.DatabaseMigrationCosmosDbMongo$DefinitionStages` was added + +* `models.GetUserTablesOracleTaskOutput` was added + +* `models.DatabaseMigrationSqlDb$UpdateStages` was added + +* `models.CopyProgressDetails` was added + +* `models.MongoDbShardKeyOrder` was added + +* `models.DatabaseMigrationsMongoToCosmosDbRUMongoes` was added + +* `models.SchemaMigrationOption` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskOutputError` was added + +* `models.DatabaseMigrationSqlDb$DefinitionStages` was added + +* `models.SystemDataAutoGenerated` was added + +* `models.MigrateMySqlAzureDbForMySqlOfflineTaskProperties` was added + +* `models.AuthenticationKeys` was added + +* `models.MongoDbObjectInfo` was added + +* `models.DatabaseMigrationCosmosDbMongoListResult` was added + +* `models.OracleConnectionInfo` was added + +* `models.TargetLocation` was added + +* `models.DatabaseMigrationPropertiesSqlMi` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskOutputError` was added + +* `models.MongoDbMigrationState` was added + +* `models.DatabaseMigrationsSqlVms` was added + +* `models.MigrateOracleAzureDbPostgreSqlSyncTaskInput` was added + +* `models.ValidateOracleAzureDbPostgreSqlSyncTaskOutput` was added + +* `models.DatabaseMigrationSqlDb` was added + +* `models.MongoDbRestartCommand` was added + +* `models.SsisMigrationStage` was added + +* `models.DatabaseMigrationSqlDb$Definition` was added + +* `models.MongoDbProgressResultType` was added + +* `models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput` was added + +* `models.CheckOciDriverTaskOutput` was added + +#### `models.MigrateSqlServerSqlMITaskInput` was modified + +* `withStartedOn(java.lang.String)` was added +* `withAadDomainName(java.lang.String)` was added +* `withEncryptedKeyForSecureFields(java.lang.String)` was added +* `startedOn()` was added +* `aadDomainName()` was added +* `encryptedKeyForSecureFields()` was added + +#### `models.MigrateSqlServerSqlDbTaskInput` was modified + +* `withEncryptedKeyForSecureFields(java.lang.String)` was added +* `encryptedKeyForSecureFields()` was added +* `startedOn()` was added +* `withStartedOn(java.lang.String)` was added + +#### `models.MigrateSqlServerSqlDbTaskOutputValidationResult` was modified + +* `id()` was added + +#### `models.QueryAnalysisValidationResult` was modified + +* `withValidationErrors(models.ValidationError)` was added +* `withQueryResults(models.QueryExecutionResult)` was added + +#### `models.ProjectTaskProperties` was modified + +* `withClientData(java.util.Map)` was added +* `clientData()` was added + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties` was modified + +* `withIsCloneable(java.lang.Boolean)` was added +* `createdOn()` was added +* `withClientData(java.util.Map)` was added +* `isCloneable()` was added +* `withCreatedOn(java.lang.String)` was added +* `withTaskId(java.lang.String)` was added +* `taskId()` was added + +#### `models.GetUserTablesSqlSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.SqlConnectionInfo` was modified + +* `resourceId()` was added +* `serverVersion()` was added +* `serverBrandVersion()` was added +* `withServerBrandVersion(java.lang.String)` was added +* `serverName()` was added +* `withPort(java.lang.Integer)` was added +* `withServerName(java.lang.String)` was added +* `withResourceId(java.lang.String)` was added +* `withServerVersion(java.lang.String)` was added +* `port()` was added + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput` was modified + +* `withSelectedTables(java.util.List)` was added +* `id()` was added +* `selectedTables()` was added + +#### `models.MigrateSqlServerSqlMIDatabaseInput` was modified + +* `withId(java.lang.String)` was added +* `id()` was added + +#### `models.GetUserTablesSqlTaskProperties` was modified + +* `withTaskId(java.lang.String)` was added +* `withClientData(java.util.Map)` was added +* `taskId()` was added + +#### `models.ConnectToTargetAzureDbForMySqlTaskInput` was modified + +* `withIsOfflineMigration(java.lang.Boolean)` was added +* `isOfflineMigration()` was added + +#### `models.ConnectToTargetSqlDbTaskProperties` was modified + +* `withClientData(java.util.Map)` was added +* `withCreatedOn(java.lang.String)` was added +* `createdOn()` was added + +#### `models.MySqlConnectionInfo` was modified + +* `dataSource()` was added +* `withEncryptConnection(java.lang.Boolean)` was added +* `authentication()` was added +* `additionalSettings()` was added +* `encryptConnection()` was added +* `withAuthentication(models.AuthenticationType)` was added +* `withDataSource(java.lang.String)` was added +* `withAdditionalSettings(java.lang.String)` was added + +#### `models.ValidationError` was modified + +* `withText(java.lang.String)` was added +* `withSeverity(models.Severity)` was added + +#### `models.ValidateMigrationInputSqlServerSqlMISyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToSourcePostgreSqlSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToSourceSqlServerSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToTargetSqlMISyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult` was modified + +* `id()` was added + +#### `models.MigrationReportResult` was modified + +* `withReportUrl(java.lang.String)` was added +* `withId(java.lang.String)` was added + +#### `models.MigrateSqlServerSqlMITaskProperties` was modified + +* `createdOn()` was added +* `withParentTaskId(java.lang.String)` was added +* `withTaskId(java.lang.String)` was added +* `taskId()` was added +* `withClientData(java.util.Map)` was added +* `parentTaskId()` was added +* `withIsCloneable(java.lang.Boolean)` was added +* `isCloneable()` was added +* `withCreatedOn(java.lang.String)` was added + +#### `models.ConnectToTargetSqlMITaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToSourceSqlServerTaskOutputTaskLevel` was modified + +* `databaseTdeCertificateMapping()` was added + +#### `models.DataMigrationService$Update` was modified + +* `withDeleteResourcesOnStop(java.lang.Boolean)` was added +* `withAutoStopDelay(java.lang.String)` was added +* `withVirtualNicId(java.lang.String)` was added + +#### `models.DataMigrationService` was modified + +* `deleteResourcesOnStop()` was added +* `checkChildrenNameAvailabilityWithResponse(models.NameAvailabilityRequest,com.azure.core.util.Context)` was added +* `checkChildrenNameAvailability(models.NameAvailabilityRequest)` was added +* `autoStopDelay()` was added +* `systemData()` was added +* `virtualNicId()` was added + +#### `models.Projects` was modified + +* `list(java.lang.String,java.lang.String)` was added +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.DataMigrationServiceStatusResponse` was modified + +* `agentConfiguration()` was added + +#### `models.ReportableException` was modified + +* `withStackTrace(java.lang.String)` was added +* `withHResult(java.lang.Integer)` was added +* `withLineNumber(java.lang.String)` was added +* `withMessage(java.lang.String)` was added +* `withFilePath(java.lang.String)` was added + +#### `models.DataIntegrityValidationResult` was modified + +* `withFailedObjects(java.util.Map)` was added +* `withValidationErrors(models.ValidationError)` was added + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput` was modified + +* `encryptedKeyForSecureFields()` was added +* `withEncryptedKeyForSecureFields(java.lang.String)` was added +* `startedOn()` was added + +#### `models.ConnectToTargetSqlDbTaskInput` was modified + +* `withQueryObjectCounts(java.lang.Boolean)` was added +* `queryObjectCounts()` was added + +#### `DataMigrationManager` was modified + +* `databaseMigrationsSqlVms()` was added +* `databaseMigrationsMongoToCosmosDbvCoreMongoes()` was added +* `databaseMigrationsSqlMis()` was added +* `files()` was added +* `databaseMigrationsMongoToCosmosDbRUMongoes()` was added +* `migrationServices()` was added +* `sqlMigrationServices()` was added +* `serviceTasks()` was added +* `databaseMigrationsSqlDbs()` was added + +#### `models.ValidateMigrationInputSqlServerSqlDbSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.CommandProperties` was modified + +* `innerModel()` was added + +#### `models.MigrateSqlServerSqlDbDatabaseInput` was modified + +* `withId(java.lang.String)` was added +* `withSchemaSetting(java.lang.Object)` was added +* `id()` was added +* `schemaSetting()` was added + +#### `models.Project` was modified + +* `systemData()` was added +* `etag()` was added +* `azureAuthenticationInfo()` was added + +#### `models.DataMigrationService$Definition` was modified + +* `withAutoStopDelay(java.lang.String)` was added +* `withDeleteResourcesOnStop(java.lang.Boolean)` was added +* `withVirtualNicId(java.lang.String)` was added + +#### `models.QueryExecutionResult` was modified + +* `withQueryText(java.lang.String)` was added +* `withTargetResult(models.ExecutionStatistics)` was added +* `withStatementsInBatch(java.lang.Long)` was added +* `withSourceResult(models.ExecutionStatistics)` was added + +#### `models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput` was modified + +* `withTableMap(java.util.Map)` was added +* `tableMap()` was added + +#### `models.SchemaComparisonValidationResult` was modified + +* `withValidationErrors(models.ValidationError)` was added +* `withSchemaDifferences(models.SchemaComparisonValidationResultType)` was added + +#### `models.ValidateMigrationInputSqlServerSqlMITaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.ConnectToSourceSqlServerTaskInput` was modified + +* `withValidateSsisCatalogOnly(java.lang.Boolean)` was added +* `withCollectTdeCertificateInfo(java.lang.Boolean)` was added +* `collectDatabases()` was added +* `validateSsisCatalogOnly()` was added +* `encryptedKeyForSecureFields()` was added +* `withCollectDatabases(java.lang.Boolean)` was added +* `withEncryptedKeyForSecureFields(java.lang.String)` was added +* `collectTdeCertificateInfo()` was added + +#### `models.MigrateSqlServerSqlDbTaskProperties` was modified + +* `withIsCloneable(java.lang.Boolean)` was added +* `isCloneable()` was added +* `createdOn()` was added +* `withClientData(java.util.Map)` was added +* `withTaskId(java.lang.String)` was added +* `withCreatedOn(java.lang.String)` was added +* `taskId()` was added + +#### `models.ConnectToTargetAzureDbForMySqlTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.GetUserTablesSqlTaskInput` was modified + +* `encryptedKeyForSecureFields()` was added +* `withEncryptedKeyForSecureFields(java.lang.String)` was added + +#### `models.MigrateSqlServerSqlMISyncTaskInput` was modified + +* `withNumberOfParallelDatabaseMigrations(java.lang.Float)` was added +* `numberOfParallelDatabaseMigrations()` was added + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel` was modified + +* `sourceServerType()` was added +* `state()` was added +* `databaseCount()` was added +* `withDatabaseCount(java.lang.Float)` was added +* `targetServerType()` was added + +#### `models.MigrateSyncCompleteCommandProperties` was modified + +* `commandId()` was added +* `errors()` was added +* `state()` was added +* `withCommandId(java.lang.String)` was added + +#### `models.ConnectToTargetSqlDbSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.SchemaComparisonValidationResultType` was modified + +* `withObjectType(models.ObjectType)` was added +* `withUpdateAction(models.UpdateActionType)` was added +* `withObjectName(java.lang.String)` was added + +#### `models.GetTdeCertificatesSqlTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.MigrateMISyncCompleteCommandProperties` was modified + +* `errors()` was added +* `state()` was added + +#### `models.ProjectTask` was modified + +* `commandWithResponse(fluent.models.CommandPropertiesInner,com.azure.core.util.Context)` was added +* `systemData()` was added +* `command(fluent.models.CommandPropertiesInner)` was added + +#### `models.ConnectToSourceSqlServerTaskOutputAgentJobLevel` was modified + +* `validationErrors()` was added + +#### `models.AzureActiveDirectoryApp` was modified + +* `ignoreAzurePermissions()` was added +* `withIgnoreAzurePermissions(java.lang.Boolean)` was added + +#### `models.ConnectToSourceMySqlTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.Services` was modified + +* `checkChildrenNameAvailability(java.lang.String,java.lang.String,models.NameAvailabilityRequest)` was added +* `checkChildrenNameAvailabilityWithResponse(java.lang.String,java.lang.String,models.NameAvailabilityRequest,com.azure.core.util.Context)` was added + +#### `models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError` was modified + +* `withEvents(java.util.List)` was added +* `events()` was added + +#### `models.PostgreSqlConnectionInfo` was modified + +* `additionalSettings()` was added +* `withDataSource(java.lang.String)` was added +* `withServerBrandVersion(java.lang.String)` was added +* `withServerVersion(java.lang.String)` was added +* `serverBrandVersion()` was added +* `withTrustServerCertificate(java.lang.Boolean)` was added +* `authentication()` was added +* `withAuthentication(models.AuthenticationType)` was added +* `serverVersion()` was added +* `trustServerCertificate()` was added +* `encryptConnection()` was added +* `withEncryptConnection(java.lang.Boolean)` was added +* `withAdditionalSettings(java.lang.String)` was added +* `dataSource()` was added + +#### `models.Project$Update` was modified + +* `withAzureAuthenticationInfo(models.AzureActiveDirectoryApp)` was added +* `withEtag(java.lang.String)` was added + +#### `models.MigrateSqlServerSqlMISyncTaskProperties` was modified + +* `withCreatedOn(java.lang.String)` was added +* `createdOn()` was added +* `withClientData(java.util.Map)` was added + +#### `models.Tasks` was modified + +* `command(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CommandPropertiesInner)` was added +* `commandWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CommandPropertiesInner,com.azure.core.util.Context)` was added + +#### `models.ExecutionStatistics` was modified + +* `withCpuTimeMs(java.lang.Float)` was added +* `withSqlErrors(java.util.List)` was added +* `withElapsedTimeMs(java.lang.Float)` was added +* `withHasErrors(java.lang.Boolean)` was added +* `withExecutionCount(java.lang.Long)` was added + +#### `models.ConnectToTargetSqlMITaskInput` was modified + +* `withCollectLogins(java.lang.Boolean)` was added +* `validateSsisCatalogOnly()` was added +* `collectLogins()` was added +* `collectAgentJobs()` was added +* `withValidateSsisCatalogOnly(java.lang.Boolean)` was added +* `withCollectAgentJobs(java.lang.Boolean)` was added + +#### `models.ConnectToSourceMySqlTaskInput` was modified + +* `withIsOfflineMigration(java.lang.Boolean)` was added +* `isOfflineMigration()` was added + +#### `models.Project$Definition` was modified + +* `withAzureAuthenticationInfo(models.AzureActiveDirectoryApp)` was added +* `withEtag(java.lang.String)` was added + +#### `models.MigrateSqlServerSqlDbTaskOutputMigrationLevel` was modified + +* `withMigrationReportResult(models.MigrationReportResult)` was added +* `migrationValidationResult()` was added +* `withMigrationValidationResult(models.MigrationValidationResult)` was added +* `migrationReportResult()` was added + +#### `models.ConnectToSourceSqlServerTaskProperties` was modified + +* `withTaskId(java.lang.String)` was added +* `withClientData(java.util.Map)` was added +* `taskId()` was added + +#### `models.MigrateMySqlAzureDbForMySqlSyncTaskProperties` was modified + +* `withClientData(java.util.Map)` was added + +#### `models.WaitStatistics` was modified + +* `withWaitTimeMs(java.lang.Float)` was added +* `withWaitType(java.lang.String)` was added +* `withWaitCount(java.lang.Long)` was added + +#### `models.MigrateSqlServerSqlDbSyncTaskProperties` was modified -### Other Changes +* `withClientData(java.util.Map)` was added ## 1.0.0 (2024-12-24) diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/README.md b/sdk/datamigration/azure-resourcemanager-datamigration/README.md index 2c302bd4b9c5..29fc4d61905b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/README.md +++ b/sdk/datamigration/azure-resourcemanager-datamigration/README.md @@ -2,7 +2,7 @@ Azure Resource Manager DataMigration client library for Java. -This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-2018-04-19. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-preview-2025-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ DataMigrationManager manager = DataMigrationManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md b/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md index f3e0c0e48a20..69cfd293e2e3 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md +++ b/sdk/datamigration/azure-resourcemanager-datamigration/SAMPLE.md @@ -1,6 +1,61 @@ # Code snippets and samples +## DatabaseMigrationsMongoToCosmosDbRUMongo + +- [Create](#databasemigrationsmongotocosmosdbrumongo_create) +- [Delete](#databasemigrationsmongotocosmosdbrumongo_delete) +- [Get](#databasemigrationsmongotocosmosdbrumongo_get) +- [GetForScope](#databasemigrationsmongotocosmosdbrumongo_getforscope) + +## DatabaseMigrationsMongoToCosmosDbvCoreMongo + +- [Create](#databasemigrationsmongotocosmosdbvcoremongo_create) +- [Delete](#databasemigrationsmongotocosmosdbvcoremongo_delete) +- [Get](#databasemigrationsmongotocosmosdbvcoremongo_get) +- [GetForScope](#databasemigrationsmongotocosmosdbvcoremongo_getforscope) + +## DatabaseMigrationsSqlDb + +- [Cancel](#databasemigrationssqldb_cancel) +- [CreateOrUpdate](#databasemigrationssqldb_createorupdate) +- [Delete](#databasemigrationssqldb_delete) +- [Get](#databasemigrationssqldb_get) + +## DatabaseMigrationsSqlMi + +- [Cancel](#databasemigrationssqlmi_cancel) +- [CreateOrUpdate](#databasemigrationssqlmi_createorupdate) +- [Cutover](#databasemigrationssqlmi_cutover) +- [Get](#databasemigrationssqlmi_get) + +## DatabaseMigrationsSqlVm + +- [Cancel](#databasemigrationssqlvm_cancel) +- [CreateOrUpdate](#databasemigrationssqlvm_createorupdate) +- [Cutover](#databasemigrationssqlvm_cutover) +- [Get](#databasemigrationssqlvm_get) + +## Files + +- [CreateOrUpdate](#files_createorupdate) +- [Delete](#files_delete) +- [Get](#files_get) +- [List](#files_list) +- [Read](#files_read) +- [ReadWrite](#files_readwrite) +- [Update](#files_update) + +## MigrationServices + +- [CreateOrUpdate](#migrationservices_createorupdate) +- [Delete](#migrationservices_delete) +- [GetByResourceGroup](#migrationservices_getbyresourcegroup) +- [List](#migrationservices_list) +- [ListByResourceGroup](#migrationservices_listbyresourcegroup) +- [ListMigrations](#migrationservices_listmigrations) +- [Update](#migrationservices_update) + ## Operations - [List](#operations_list) @@ -10,15 +65,25 @@ - [CreateOrUpdate](#projects_createorupdate) - [Delete](#projects_delete) - [Get](#projects_get) -- [ListByResourceGroup](#projects_listbyresourcegroup) +- [List](#projects_list) - [Update](#projects_update) ## ResourceSkus - [List](#resourceskus_list) +## ServiceTasks + +- [Cancel](#servicetasks_cancel) +- [CreateOrUpdate](#servicetasks_createorupdate) +- [Delete](#servicetasks_delete) +- [Get](#servicetasks_get) +- [List](#servicetasks_list) +- [Update](#servicetasks_update) + ## Services +- [CheckChildrenNameAvailability](#services_checkchildrennameavailability) - [CheckNameAvailability](#services_checknameavailability) - [CheckStatus](#services_checkstatus) - [CreateOrUpdate](#services_createorupdate) @@ -27,14 +92,28 @@ - [List](#services_list) - [ListByResourceGroup](#services_listbyresourcegroup) - [ListSkus](#services_listskus) -- [NestedCheckNameAvailability](#services_nestedchecknameavailability) - [Start](#services_start) - [Stop](#services_stop) - [Update](#services_update) +## SqlMigrationServices + +- [CreateOrUpdate](#sqlmigrationservices_createorupdate) +- [Delete](#sqlmigrationservices_delete) +- [DeleteNode](#sqlmigrationservices_deletenode) +- [GetByResourceGroup](#sqlmigrationservices_getbyresourcegroup) +- [List](#sqlmigrationservices_list) +- [ListAuthKeys](#sqlmigrationservices_listauthkeys) +- [ListByResourceGroup](#sqlmigrationservices_listbyresourcegroup) +- [ListMigrations](#sqlmigrationservices_listmigrations) +- [ListMonitoringData](#sqlmigrationservices_listmonitoringdata) +- [RegenerateAuthKeys](#sqlmigrationservices_regenerateauthkeys) +- [Update](#sqlmigrationservices_update) + ## Tasks - [Cancel](#tasks_cancel) +- [Command](#tasks_command) - [CreateOrUpdate](#tasks_createorupdate) - [Delete](#tasks_delete) - [Get](#tasks_get) @@ -44,133 +123,178 @@ ## Usages - [List](#usages_list) -### Operations_List +### DatabaseMigrationsMongoToCosmosDbRUMongo_Create ```java /** - * Samples for Operations List. + * Samples for Tasks List. */ -public final class OperationsListSamples { +public final class TasksListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Operations_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_List.json */ /** - * Sample code: Operations_List. + * Sample code: Tasks_List. * * @param manager Entry point to DataMigrationManager. */ - public static void operationsList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void tasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, com.azure.core.util.Context.NONE); } } ``` -### Projects_CreateOrUpdate +### DatabaseMigrationsMongoToCosmosDbRUMongo_Delete ```java -import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; -import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +/** + * Samples for Tasks Get. + */ +public final class TasksGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### DatabaseMigrationsMongoToCosmosDbRUMongo_Get +```java /** - * Samples for Projects CreateOrUpdate. + * Samples for Projects List. */ -public final class ProjectsCreateOrUpdateSamples { +public final class ProjectsListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Projects_CreateOrUpdate.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_List.json */ /** - * Sample code: Projects_CreateOrUpdate. + * Sample code: Projects_List. * * @param manager Entry point to DataMigrationManager. */ - public static void projectsCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.projects() - .define("DmsSdkProject") - .withRegion("southcentralus") - .withExistingService("DmsSdkRg", "DmsSdkService") - .withSourcePlatform(ProjectSourcePlatform.SQL) - .withTargetPlatform(ProjectTargetPlatform.SQLDB) - .create(); + public static void projectsList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects().list("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); } } ``` -### Projects_Delete +### DatabaseMigrationsMongoToCosmosDbRUMongo_GetForScope ```java + /** - * Samples for Projects Delete. + * Samples for DatabaseMigrationsSqlVm Get. */ -public final class ProjectsDeleteSamples { +public final class DatabaseMigrationsSqlVmGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Delete. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmGetDatabaseMigrationExpanded.json */ /** - * Sample code: Projects_Delete. + * Sample code: Get Sql VM database Migration with the expand parameter. * * @param manager Entry point to DataMigrationManager. */ - public static void projectsDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.projects() - .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, com.azure.core.util.Context.NONE); + public static void getSqlVMDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .getWithResponse("testrg", "testvm", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql VM database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlVMDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .getWithResponse("testrg", "testvm", "db1", null, null, com.azure.core.util.Context.NONE); } } ``` -### Projects_Get +### DatabaseMigrationsMongoToCosmosDbvCoreMongo_Create ```java /** - * Samples for Projects Get. + * Samples for Files ReadWrite. */ -public final class ProjectsGetSamples { +public final class FilesReadWriteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_ReadWrite.json */ /** - * Sample code: Projects_Get. + * Sample code: Files_List. * * @param manager Entry point to DataMigrationManager. */ - public static void projectsGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.projects() - .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", com.azure.core.util.Context.NONE); + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .readWriteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE); } } ``` -### Projects_ListByResourceGroup +### DatabaseMigrationsMongoToCosmosDbvCoreMongo_Delete ```java +import com.azure.resourcemanager.datamigration.models.ServiceSku; + /** - * Samples for Projects ListByResourceGroup. + * Samples for Services CreateOrUpdate. */ -public final class ProjectsListByResourceGroupSamples { +public final class ServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_CreateOrUpdate.json */ /** - * Sample code: Projects_ListByResourceGroup. + * Sample code: Services_CreateOrUpdate. * * @param manager Entry point to DataMigrationManager. */ - public static void - projectsListByResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.projects().listByResourceGroup("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services() + .define("DmsSdkService") + .withRegion("southcentralus") + .withExistingResourceGroup("DmsSdkRg") + .withSku(new ServiceSku().withName("Basic_1vCore")) + .withVirtualSubnetId( + "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") + .create(); } } ``` -### Projects_Update +### DatabaseMigrationsMongoToCosmosDbvCoreMongo_Get ```java import com.azure.resourcemanager.datamigration.models.Project; @@ -183,8 +307,8 @@ import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; public final class ProjectsUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Update. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Update.json */ /** * Sample code: Projects_Update. @@ -203,466 +327,608 @@ public final class ProjectsUpdateSamples { } ``` -### ResourceSkus_List +### DatabaseMigrationsMongoToCosmosDbvCoreMongo_GetForScope ```java /** - * Samples for ResourceSkus List. + * Samples for ServiceTasks List. */ -public final class ResourceSkusListSamples { +public final class ServiceTasksListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * ResourceSkus_ListSkus.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_List.json */ /** - * Sample code: ListSkus. + * Sample code: ServiceTasks_List. * * @param manager Entry point to DataMigrationManager. */ - public static void listSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.resourceSkus().list(com.azure.core.util.Context.NONE); + public static void serviceTasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().list("DmsSdkRg", "DmsSdkService", null, com.azure.core.util.Context.NONE); } } ``` -### Services_CheckNameAvailability +### DatabaseMigrationsSqlDb_Cancel ```java -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; - /** - * Samples for Services CheckNameAvailability. + * Samples for Files Read. */ -public final class ServicesCheckNameAvailabilitySamples { +public final class FilesReadSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_CheckNameAvailability.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Read.json */ /** - * Sample code: Services_CheckNameAvailability. + * Sample code: Files_List. * * @param manager Entry point to DataMigrationManager. */ - public static void - servicesCheckNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services() - .checkNameAvailabilityWithResponse("eastus", new NameAvailabilityRequest(), + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .readWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", com.azure.core.util.Context.NONE); } } ``` -### Services_CheckStatus +### DatabaseMigrationsSqlDb_CreateOrUpdate ```java /** - * Samples for Services CheckStatus. + * Samples for MigrationServices GetByResourceGroup. */ -public final class ServicesCheckStatusSamples { +public final class MigrationServicesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_CheckStatus.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetMigrationService.json */ /** - * Sample code: Services_CheckStatus. + * Sample code: Get Migration Service. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesCheckStatus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().checkStatusWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void getMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .getByResourceGroupWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); } } ``` -### Services_CreateOrUpdate +### DatabaseMigrationsSqlDb_Delete ```java -import com.azure.resourcemanager.datamigration.models.ServiceSku; - /** - * Samples for Services CreateOrUpdate. + * Samples for MigrationServices ListMigrations. */ -public final class ServicesCreateOrUpdateSamples { +public final class MigrationServicesListMigrationsSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_CreateOrUpdate.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListMigrationsByMigrationService.json */ /** - * Sample code: Services_CreateOrUpdate. + * Sample code: List database migrations attached to the service. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services() - .define("DmsSdkService") - .withRegion("southcentralus") - .withExistingResourceGroup("DmsSdkRg") - .withSku(new ServiceSku().withName("Basic_1vCore")) - .withVirtualSubnetId( - "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") - .create(); + public static void listDatabaseMigrationsAttachedToTheService( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().listMigrations("testrg", "testMigrationService", com.azure.core.util.Context.NONE); } } ``` -### Services_Delete +### DatabaseMigrationsSqlDb_Get ```java /** - * Samples for Services Delete. + * Samples for SqlMigrationServices CreateOrUpdate. */ -public final class ServicesDeleteSamples { +public final class SqlMigrationServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Delete. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateSqlMigrationServiceMAX.json */ /** - * Sample code: Services_CreateOrUpdate. + * Sample code: Create or Update SQL Migration Service with maximum parameters. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().delete("DmsSdkRg", "DmsSdkService", null, com.azure.core.util.Context.NONE); + public static void createOrUpdateSQLMigrationServiceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); } -} -``` - -### Services_GetByResourceGroup -```java -/** - * Samples for Services GetByResourceGroup. - */ -public final class ServicesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateSqlMigrationServiceMIN.json */ /** - * Sample code: Services_CreateOrUpdate. + * Sample code: Create or Update SQL Migration Service with minimum parameters. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services() - .getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void createOrUpdateSQLMigrationServiceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); } } ``` -### Services_List +### DatabaseMigrationsSqlMi_Cancel ```java +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + /** - * Samples for Services List. + * Samples for DatabaseMigrationsSqlMi Cancel. */ -public final class ServicesListSamples { +public final class DatabaseMigrationsSqlMiCancelSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCancelDatabaseMigration.json */ /** - * Sample code: Services_List. + * Sample code: Stop ongoing migration for the database. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().list(com.azure.core.util.Context.NONE); + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .cancel("testrg", "managedInstance1", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); } } ``` -### Services_ListByResourceGroup +### DatabaseMigrationsSqlMi_CreateOrUpdate ```java +import com.azure.resourcemanager.datamigration.models.AuthenticationType; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; + /** - * Samples for Services ListByResourceGroup. + * Samples for Tasks CreateOrUpdate. */ -public final class ServicesListByResourceGroupSamples { +public final class TasksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_ListByResourceGroup.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_CreateOrUpdate.json */ /** - * Sample code: Services_ListByResourceGroup. + * Sample code: Tasks_CreateOrUpdate. * * @param manager Entry point to DataMigrationManager. */ - public static void - servicesListByResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().listByResourceGroup("DmsSdkRg", com.azure.core.util.Context.NONE); + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .define("DmsSdkTask") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties(new ConnectToTargetSqlDbTaskProperties().withInput(new ConnectToTargetSqlDbTaskInput() + .withTargetConnectionInfo(new SqlConnectionInfo().withUsername("testuser") + .withPassword("fakeTokenPlaceholder") + .withDataSource("ssma-test-server.database.windows.net") + .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) + .withEncryptConnection(true) + .withTrustServerCertificate(true)))) + .create(); } } ``` -### Services_ListSkus +### DatabaseMigrationsSqlMi_Cutover ```java +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + /** - * Samples for Services ListSkus. + * Samples for DatabaseMigrationsSqlVm Cancel. */ -public final class ServicesListSkusSamples { +public final class DatabaseMigrationsSqlVmCancelSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_ListSkus - * .json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCancelDatabaseMigration.json */ /** - * Sample code: Services_ListSkus. + * Sample code: Stop ongoing migration for the database. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesListSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().listSkus("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .cancel("testrg", "testvm", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); } } ``` -### Services_NestedCheckNameAvailability +### DatabaseMigrationsSqlMi_Get ```java -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; - /** - * Samples for Services NestedCheckNameAvailability. + * Samples for Files Delete. */ -public final class ServicesNestedCheckNameAvailabilitySamples { +public final class FilesDeleteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_NestedCheckNameAvailability.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Delete.json */ /** - * Sample code: Services_NestedCheckNameAvailability. + * Sample code: Files_Delete. * * @param manager Entry point to DataMigrationManager. */ - public static void - servicesNestedCheckNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services() - .nestedCheckNameAvailabilityWithResponse("DmsSdkRg", "DmsSdkService", new NameAvailabilityRequest(), + public static void filesDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", com.azure.core.util.Context.NONE); } } ``` -### Services_Start +### DatabaseMigrationsSqlVm_Cancel ```java /** - * Samples for Services Start. + * Samples for Projects Get. */ -public final class ServicesStartSamples { +public final class ProjectsGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Start. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Get.json */ /** - * Sample code: Services_Start. + * Sample code: Projects_Get. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesStart(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().start("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void projectsGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", com.azure.core.util.Context.NONE); } } ``` -### Services_Stop +### DatabaseMigrationsSqlVm_CreateOrUpdate ```java + /** - * Samples for Services Stop. + * Samples for DatabaseMigrationsSqlDb Get. */ -public final class ServicesStopSamples { +public final class DatabaseMigrationsSqlDbGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Stop. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbGetDatabaseMigration.json */ /** - * Sample code: Services_Stop. + * Sample code: Get Sql DB database Migration without the expand parameter. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesStop(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services().stop("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void getSqlDBDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .getWithResponse("testrg", "sqldbinstance", "db1", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql DB database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlDBDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .getWithResponse("testrg", "sqldbinstance", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); } } ``` -### Services_Update +### DatabaseMigrationsSqlVm_Cutover ```java -import com.azure.resourcemanager.datamigration.models.DataMigrationService; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import java.util.Arrays; /** - * Samples for Services Update. + * Samples for DatabaseMigrationsSqlDb CreateOrUpdate. */ -public final class ServicesUpdateSamples { +public final class DatabaseMigrationsSqlDbCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Update. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCreateOrUpdateDatabaseMigrationMAX.json */ /** - * Sample code: Services_CreateOrUpdate. + * Sample code: Create or Update Database Migration resource with Maximum parameters. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - DataMigrationService resource = manager.services() - .getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withVirtualSubnetId( - "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") - .apply(); + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties(new DatabaseMigrationPropertiesSqlDb().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withTargetSqlConnection(new SqlConnectionInformation().withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withTableList(Arrays.asList("[Schema1].[TableName1]", "[Schema2].[TableName2]"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties(new DatabaseMigrationPropertiesSqlDb().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withTargetSqlConnection(new SqlConnectionInformation().withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true))) + .create(); } } ``` -### Tasks_Cancel +### DatabaseMigrationsSqlVm_Get ```java /** - * Samples for Tasks Cancel. + * Samples for SqlMigrationServices List. */ -public final class TasksCancelSamples { +public final class SqlMigrationServicesListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Cancel.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListBySubscriptionSqlMigrationService.json */ /** - * Sample code: Tasks_Cancel. + * Sample code: Get Services in the Subscriptions. * * @param manager Entry point to DataMigrationManager. */ - public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.tasks() - .cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", - com.azure.core.util.Context.NONE); + public static void + getServicesInTheSubscriptions(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().list(com.azure.core.util.Context.NONE); } } ``` -### Tasks_CreateOrUpdate +### Files_CreateOrUpdate ```java -import com.azure.resourcemanager.datamigration.models.AuthenticationType; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskInput; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskProperties; -import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; - /** - * Samples for Tasks CreateOrUpdate. + * Samples for Usages List. */ -public final class TasksCreateOrUpdateSamples { +public final class UsagesListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Tasks_CreateOrUpdate.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Usages_List.json */ /** - * Sample code: Tasks_CreateOrUpdate. + * Sample code: Services_Usages. * * @param manager Entry point to DataMigrationManager. */ - public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.tasks() - .define("DmsSdkTask") - .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") - .withProperties(new ConnectToTargetSqlDbTaskProperties().withInput(new ConnectToTargetSqlDbTaskInput() - .withTargetConnectionInfo(new SqlConnectionInfo().withUsername("testuser") - .withPassword("fakeTokenPlaceholder") - .withDataSource("ssma-test-server.database.windows.net") - .withAuthentication(AuthenticationType.SQL_AUTHENTICATION) - .withEncryptConnection(true) - .withTrustServerCertificate(true)))) - .create(); + public static void servicesUsages(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.usages().list("westus", com.azure.core.util.Context.NONE); } } ``` -### Tasks_Delete +### Files_Delete ```java /** - * Samples for Tasks Delete. + * Samples for Files Get. */ -public final class TasksDeleteSamples { +public final class FilesGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Delete.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Get.json */ /** - * Sample code: Tasks_Delete. + * Sample code: Files_List. * * @param manager Entry point to DataMigrationManager. */ - public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.tasks() - .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", com.azure.core.util.Context.NONE); } } ``` -### Tasks_Get +### Files_Get ```java +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.MongoConnectionInformation; +import com.azure.resourcemanager.datamigration.models.MongoMigrationCollection; +import java.util.Arrays; + /** - * Samples for Tasks Get. + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Create. */ -public final class TasksGetSamples { +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMIN.json */ /** - * Sample code: Tasks_Get. + * Sample code: Create Mongo to CosmosDb Mongo(vCore) Database Migration resource with Minimum parameters. * * @param manager Entry point to DataMigrationManager. */ - public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.tasks() - .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, + public static void createMongoToCosmosDbMongoVCoreDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .create("testrg", "targetCosmosDbClusterName", "migrationRequest", new DatabaseMigrationCosmosDbMongoInner() + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection(new MongoConnectionInformation().withConnectionString("placeholder")) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(vCore) Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoVCoreDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .create("testrg", "targetCosmosDbClusterName", "migrationRequest", new DatabaseMigrationCosmosDbMongoInner() + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection( + new MongoConnectionInformation().withHost("xyz.mongocluster.cosmos.azure.com") + .withPort(10255) + .withUsername("def") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2") + .withTargetDatabase("sourceDb2") + .withTargetCollection("sourceCol2")))), com.azure.core.util.Context.NONE); } } ``` -### Tasks_List +### Files_List ```java /** - * Samples for Tasks List. + * Samples for MigrationServices List. */ -public final class TasksListSamples { +public final class MigrationServicesListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_List.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListBySubscriptionMigrationService.json */ /** - * Sample code: Tasks_List. + * Sample code: Get Services in the Subscriptions. * * @param manager Entry point to DataMigrationManager. */ - public static void tasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.tasks().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, com.azure.core.util.Context.NONE); + public static void + getServicesInTheSubscriptions(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().list(com.azure.core.util.Context.NONE); } } ``` -### Tasks_Update +### Files_Read ```java import com.azure.resourcemanager.datamigration.models.AuthenticationType; @@ -677,7 +943,8 @@ import com.azure.resourcemanager.datamigration.models.SqlConnectionInfo; public final class TasksUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Update.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Update.json */ /** * Sample code: Tasks_Update. @@ -702,24 +969,1759 @@ public final class TasksUpdateSamples { } ``` -### Usages_List +### Files_ReadWrite ```java /** - * Samples for Usages List. + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Delete. */ -public final class UsagesListSamples { +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Usages_List.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoDeleteDatabaseMigration.json */ /** - * Sample code: Services_Usages. + * Sample code: Delete Mongo to CosmosDb Mongo(vCore) Database Migration resource. * * @param manager Entry point to DataMigrationManager. */ - public static void servicesUsages(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.usages().list("westus", com.azure.core.util.Context.NONE); + public static void deleteMongoToCosmosDbMongoVCoreDatabaseMigrationResource( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .delete("testrg", "targetCosmosDbClusterName", "migrationRequest", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Files_Update + +```java +/** + * Samples for MigrationServices ListByResourceGroup. + */ +public final class MigrationServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListByResourceGroupMigrationService.json + */ + /** + * Sample code: Get Migration Services in the Resource Group. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getMigrationServicesInTheResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskProperties; +import com.azure.resourcemanager.datamigration.models.MySqlConnectionInfo; + +/** + * Samples for ServiceTasks Update. + */ +public final class ServiceTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Update.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .updateWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", new ProjectTaskInner() + .withProperties(new ConnectToSourceMySqlTaskProperties().withInput(new ConnectToSourceMySqlTaskInput() + .withSourceConnectionInfo(new MySqlConnectionInfo().withServerName("localhost").withPort(3306)))), + com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationServices_Delete + +```java +/** + * Samples for DatabaseMigrationsSqlDb Delete. + */ +public final class DatabaseMigrationsSqlDbDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + deleteDatabaseMigrationResource(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .delete("testrg", "sqldbinstance", "db1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationServices_GetByResourceGroup + +```java +/** + * Samples for SqlMigrationServices GetByResourceGroup. + */ +public final class SqlMigrationServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetSqlMigrationService.json + */ + /** + * Sample code: Get Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .getByResourceGroupWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationServices_List + +```java +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; + +/** + * Samples for Projects CreateOrUpdate. + */ +public final class ProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_CreateOrUpdate.json + */ + /** + * Sample code: Projects_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects() + .define("DmsSdkProject") + .withRegion("southcentralus") + .withExistingService("DmsSdkRg", "DmsSdkService") + .withSourcePlatform(ProjectSourcePlatform.SQL) + .withTargetPlatform(ProjectTargetPlatform.SQLDB) + .create(); + } +} +``` + +### MigrationServices_ListByResourceGroup + +```java +/** + * Samples for MigrationServices CreateOrUpdate. + */ +public final class MigrationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateMigrationServiceMIN.json + */ + /** + * Sample code: Create or Update Migration Service with minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateMigrationServiceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateMigrationServiceMAX.json + */ + /** + * Sample code: Create or Update Migration Service with maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateMigrationServiceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } +} +``` + +### MigrationServices_ListMigrations + +```java +/** + * Samples for Projects Delete. + */ +public final class ProjectsDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Delete.json + */ + /** + * Sample code: Projects_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void projectsDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", null, com.azure.core.util.Context.NONE); + } +} +``` + +### MigrationServices_Update + +```java +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Get. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; + +/** + * Samples for Tasks Command. + */ +public final class TasksCommandSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Command.json + */ + /** + * Sample code: Tasks_Command. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCommand(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .commandWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", + new MigrateSyncCompleteCommandProperties() + .withInput(new MigrateSyncCompleteCommandInput().withDatabaseName("TestDatabase")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_CreateOrUpdate + +```java +import com.azure.resourcemanager.datamigration.models.DataMigrationService; + +/** + * Samples for Services Update. + */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Update.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + DataMigrationService resource = manager.services() + .getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withVirtualSubnetId( + "/subscriptions/fc04246f-04c5-437e-ac5e-206a19e7193f/resourceGroups/DmsSdkTestNetwork/providers/Microsoft.Network/virtualNetworks/DmsSdkTestNetwork/subnets/default") + .apply(); + } +} +``` + +### Projects_Delete + +```java +/** + * Samples for MigrationServices Delete. + */ +public final class MigrationServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteMigrationService.json + */ + /** + * Sample code: Delete Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().delete("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Get + +```java +/** + * Samples for Services Start. + */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Start.json + */ + /** + * Sample code: Services_Start. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesStart(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().start("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_List + +```java +/** + * Samples for SqlMigrationServices Delete. + */ +public final class SqlMigrationServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteSqlMigrationService.json + */ + /** + * Sample code: Delete SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().delete("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### Projects_Update + +```java +/** + * Samples for SqlMigrationServices ListMonitoringData. + */ +public final class SqlMigrationServicesListMonitoringDataSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetMonitorDataSqlMigrationService.json + */ + /** + * Sample code: Retrieve the Monitoring Data. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void retrieveTheMonitoringData(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .listMonitoringDataWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceSkus_List + +```java + +/** + * Samples for DatabaseMigrationsSqlMi Get. + */ +public final class DatabaseMigrationsSqlMiGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql MI database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql MI database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_Cancel + +```java +/** + * Samples for ServiceTasks Get. + */ +public final class ServiceTasksGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_CreateOrUpdate + +```java +/** + * Samples for SqlMigrationServices ListByResourceGroup. + */ +public final class SqlMigrationServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListByResourceGroupSqlMigrationService.json + */ + /** + * Sample code: Get Migration Services in the Resource Group. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getMigrationServicesInTheResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_Delete + +```java +/** + * Samples for Tasks Delete. + */ +public final class TasksDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_Get + +```java +/** + * Samples for SqlMigrationServices ListAuthKeys. + */ +public final class SqlMigrationServicesListAuthKeysSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListAuthKeysSqlMigrationService.json + */ + /** + * Sample code: Retrieve the List of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + retrieveTheListOfAuthenticationKeys(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listAuthKeysWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_List + +```java +/** + * Samples for Tasks Cancel. + */ +public final class TasksCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", + com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTasks_Update + +```java +/** + * Samples for ServiceTasks Cancel. + */ +public final class ServiceTasksCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_CheckChildrenNameAvailability + +```java +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Get. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } +} +``` + +### Services_CheckNameAvailability + +```java +import com.azure.resourcemanager.datamigration.models.MigrationService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MigrationServices Update. + */ +public final class MigrationServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * UpdateMigrationService.json + */ + /** + * Sample code: Update Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void updateMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + MigrationService resource = manager.migrationServices() + .getByResourceGroupWithResponse("testrg", "testagent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Services_CheckStatus + +```java +/** + * Samples for Services List. + */ +public final class ServicesListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_List.json + */ + /** + * Sample code: Services_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +/** + * Samples for Services ListSkus. + */ +public final class ServicesListSkusSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_ListSkus.json + */ + /** + * Sample code: Services_ListSkus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesListSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().listSkus("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Delete + +```java +/** + * Samples for Services Stop. + */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Stop.json + */ + /** + * Sample code: Services_Stop. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesStop(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().stop("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_GetByResourceGroup + +```java +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlDb Cancel. + */ +public final class DatabaseMigrationsSqlDbCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .cancel("testrg", "sqldbinstance", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("9a90bb84-e70f-46f7-b0ae-1aef5b3b9f07")), com.azure.core.util.Context.NONE); + } +} +``` + +### Services_List + +```java +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo GetForScope. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListByResourceGroup + +```java +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqlMigrationServices Update. + */ +public final class SqlMigrationServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * UpdateSqlMigrationService.json + */ + /** + * Sample code: Update SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void updateSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + SqlMigrationService resource = manager.sqlMigrationServices() + .getByResourceGroupWithResponse("testrg", "testagent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Services_ListSkus + +```java +/** + * Samples for Files List. + */ +public final class FilesListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_List.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Start + +```java +/** + * Samples for Services Delete. + */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Delete.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().delete("DmsSdkRg", "DmsSdkService", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Stop + +```java +/** + * Samples for Services ListByResourceGroup. + */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_ListByResourceGroup.json + */ + /** + * Sample code: Services_ListByResourceGroup. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + servicesListByResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().listByResourceGroup("DmsSdkRg", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Update + +```java +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** + * Samples for Files CreateOrUpdate. + */ +public final class FilesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_CreateOrUpdate.json + */ + /** + * Sample code: Files_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .define("x114d023d8") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .create(); + } +} +``` + +### SqlMigrationServices_CreateOrUpdate + +```java +/** + * Samples for ServiceTasks Delete. + */ +public final class ServiceTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_Delete + +```java +/** + * Samples for Services GetByResourceGroup. + */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Get.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services() + .getByResourceGroupWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_DeleteNode + +```java +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskProperties; +import com.azure.resourcemanager.datamigration.models.MySqlConnectionInfo; + +/** + * Samples for ServiceTasks CreateOrUpdate. + */ +public final class ServiceTasksCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_CreateOrUpdate.json + */ + /** + * Sample code: Tasks_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .createOrUpdateWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", new ProjectTaskInner() + .withProperties(new ConnectToSourceMySqlTaskProperties().withInput(new ConnectToSourceMySqlTaskInput() + .withSourceConnectionInfo(new MySqlConnectionInfo().withServerName("localhost").withPort(3306)))), + com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_GetByResourceGroup + +```java +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** + * Samples for SqlMigrationServices RegenerateAuthKeys. + */ +public final class SqlMigrationServicesRegenerateAuthKeysSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * RegenAuthKeysSqlMigrationService.json + */ + /** + * Sample code: Regenerate the of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + regenerateTheOfAuthenticationKeys(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .regenerateAuthKeysWithResponse("testrg", "service1", + new RegenAuthKeysInner().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_List + +```java +/** + * Samples for SqlMigrationServices ListMigrations. + */ +public final class SqlMigrationServicesListMigrationsSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListMigrationsBySqlMigrationService.json + */ + /** + * Sample code: List database migrations attached to the service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listDatabaseMigrationsAttachedToTheService( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listMigrations("testrg", "service1", com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_ListAuthKeys + +```java +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlMi Cutover. + */ +public final class DatabaseMigrationsSqlMiCutoverSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .cutover("testrg", "managedInstance1", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_ListByResourceGroup + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListOperation.json + */ + /** + * Sample code: Lists all of the available SQL Rest API operations. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listsAllOfTheAvailableSQLRestAPIOperations( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_ListMigrations + +```java +import com.azure.resourcemanager.datamigration.models.AuthType; +import com.azure.resourcemanager.datamigration.models.AzureBlob; +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datamigration.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; +import com.azure.resourcemanager.datamigration.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationsSqlMi CreateOrUpdate. + */ +public final class DatabaseMigrationsSqlMiCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationBlobManagedIdentity.json + */ + /** + * Sample code: Create or Update Database Migration resource from Azure Blob using Managed Identity. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceFromAzureBlobUsingManagedIdentity( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration().withSourceLocation( + new SourceLocation().withAzureBlob(new AzureBlob().withAuthType(AuthType.MANAGED_IDENTITY) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + new UserAssignedIdentity()))) + .withStorageAccountResourceId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withBlobContainerName("test")))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SqlMigrationServices_ListMonitoringData + +```java +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.MongoConnectionInformation; +import com.azure.resourcemanager.datamigration.models.MongoMigrationCollection; +import java.util.Arrays; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Create. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(RU) Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoRUDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .define("migrationRequest") + .withExistingDatabaseAccount("testrg", "targetCosmosDbClusterName") + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection( + new MongoConnectionInformation().withHost("xyz.mongocluster.cosmos.azure.com") + .withPort(10255) + .withUsername("def") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2") + .withTargetDatabase("sourceDb2") + .withTargetCollection("sourceCol2")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(RU) Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoRUDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .define("migrationRequest") + .withExistingDatabaseAccount("testrg", "targetCosmosDbClusterName") + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection(new MongoConnectionInformation().withConnectionString("placeholder")) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2").withSourceCollection("sourceCol2")))) + .create(); + } +} +``` + +### SqlMigrationServices_RegenerateAuthKeys + +```java +/** + * Samples for ResourceSkus List. + */ +public final class ResourceSkusListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ResourceSkus_ListSkus.json + */ + /** + * Sample code: ListSkus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listSkus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.resourceSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SqlMigrationServices_Update + +```java +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; + +/** + * Samples for SqlMigrationServices DeleteNode. + */ +public final class SqlMigrationServicesDeleteNodeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteIntegrationRuntimeNode.json + */ + /** + * Sample code: Delete the integration runtime node. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + deleteTheIntegrationRuntimeNode(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .deleteNodeWithResponse("testrg", "service1", + new DeleteNodeInner().withNodeName("nodeName").withIntegrationRuntimeName("IRName"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Cancel + +```java +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** + * Samples for Services CheckNameAvailability. + */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_CheckNameAvailability.json + */ + /** + * Sample code: Services_CheckNameAvailability. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + servicesCheckNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services() + .checkNameAvailabilityWithResponse("eastus", + new NameAvailabilityRequest().withName("DmsSdkService").withType("services"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Command + +```java +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** + * Samples for Files Update. + */ +public final class FilesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Update.json + */ + /** + * Sample code: Files_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + ProjectFile resource = manager.files() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .apply(); + } +} +``` + +### Tasks_CreateOrUpdate + +```java +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo GetForScope. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Delete + +```java +/** + * Samples for Services CheckStatus. + */ +public final class ServicesCheckStatusSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_CheckStatus.json + */ + /** + * Sample code: Services_CheckStatus. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void servicesCheckStatus(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services().checkStatusWithResponse("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Get + +```java +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Delete. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Mongo to CosmosDb Mongo(RU) Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteMongoToCosmosDbMongoRUDatabaseMigrationResource( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .delete("testrg", "targetCosmosDbClusterName", "migrationRequest", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_List + +```java +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlVm Cutover. + */ +public final class DatabaseMigrationsSqlVmCutoverSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .cutover("testrg", "testvm", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} +``` + +### Tasks_Update + +```java +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** + * Samples for Services CheckChildrenNameAvailability. + */ +public final class ServicesCheckChildrenNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_CheckChildrenNameAvailability.json + */ + /** + * Sample code: Services_CheckChildrenNameAvailability. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + servicesCheckChildrenNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services() + .checkChildrenNameAvailabilityWithResponse("DmsSdkRg", "DmsSdkService", + new NameAvailabilityRequest().withName("Task1").withType("tasks"), com.azure.core.util.Context.NONE); + } +} +``` + +### Usages_List + +```java +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; + +/** + * Samples for DatabaseMigrationsSqlVm CreateOrUpdate. + */ +public final class DatabaseMigrationsSqlVmCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties(new DatabaseMigrationPropertiesSqlVm().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties(new DatabaseMigrationPropertiesSqlVm().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder")))) + .create(); } } ``` diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml index 54f6afa11759..ed95594c4f66 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml +++ b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml @@ -18,7 +18,7 @@ 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. + This package contains Microsoft Azure SDK for DataMigration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Data Migration Client. Package tag package-preview-2025-03. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true 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 480feb094f4a..35dec058a818 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 @@ -22,25 +22,45 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; 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.DatabaseMigrationsMongoToCosmosDbRUMongoesImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlDbsImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlMisImpl; +import com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlVmsImpl; +import com.azure.resourcemanager.datamigration.implementation.FilesImpl; +import com.azure.resourcemanager.datamigration.implementation.MigrationServicesImpl; import com.azure.resourcemanager.datamigration.implementation.OperationsImpl; import com.azure.resourcemanager.datamigration.implementation.ProjectsImpl; import com.azure.resourcemanager.datamigration.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.datamigration.implementation.ServiceTasksImpl; import com.azure.resourcemanager.datamigration.implementation.ServicesImpl; +import com.azure.resourcemanager.datamigration.implementation.SqlMigrationServicesImpl; import com.azure.resourcemanager.datamigration.implementation.TasksImpl; import com.azure.resourcemanager.datamigration.implementation.UsagesImpl; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsMongoToCosmosDbRUMongoes; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsMongoToCosmosDbvCoreMongoes; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlDbs; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlMis; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlVms; +import com.azure.resourcemanager.datamigration.models.Files; +import com.azure.resourcemanager.datamigration.models.MigrationServices; import com.azure.resourcemanager.datamigration.models.Operations; import com.azure.resourcemanager.datamigration.models.Projects; import com.azure.resourcemanager.datamigration.models.ResourceSkus; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; import com.azure.resourcemanager.datamigration.models.Services; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServices; import com.azure.resourcemanager.datamigration.models.Tasks; import com.azure.resourcemanager.datamigration.models.Usages; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -49,17 +69,35 @@ * Data Migration Client. */ public final class DataMigrationManager { + private DatabaseMigrationsMongoToCosmosDbRUMongoes databaseMigrationsMongoToCosmosDbRUMongoes; + + private DatabaseMigrationsMongoToCosmosDbvCoreMongoes databaseMigrationsMongoToCosmosDbvCoreMongoes; + + private DatabaseMigrationsSqlDbs databaseMigrationsSqlDbs; + + private DatabaseMigrationsSqlMis databaseMigrationsSqlMis; + + private DatabaseMigrationsSqlVms databaseMigrationsSqlVms; + + private Operations operations; + + private MigrationServices migrationServices; + + private SqlMigrationServices sqlMigrationServices; + private ResourceSkus resourceSkus; private Services services; private Tasks tasks; + private ServiceTasks serviceTasks; + private Projects projects; private Usages usages; - private Operations operations; + private Files files; private final DataMigrationManagementClient clientObject; @@ -113,6 +151,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-datamigration.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -220,12 +261,14 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.datamigration") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -271,6 +314,108 @@ public DataMigrationManager authenticate(TokenCredential credential, AzureProfil } } + /** + * Gets the resource collection API of DatabaseMigrationsMongoToCosmosDbRUMongoes. It manages + * DatabaseMigrationCosmosDbMongo. + * + * @return Resource collection API of DatabaseMigrationsMongoToCosmosDbRUMongoes. + */ + public DatabaseMigrationsMongoToCosmosDbRUMongoes databaseMigrationsMongoToCosmosDbRUMongoes() { + if (this.databaseMigrationsMongoToCosmosDbRUMongoes == null) { + this.databaseMigrationsMongoToCosmosDbRUMongoes = new DatabaseMigrationsMongoToCosmosDbRUMongoesImpl( + clientObject.getDatabaseMigrationsMongoToCosmosDbRUMongoes(), this); + } + return databaseMigrationsMongoToCosmosDbRUMongoes; + } + + /** + * Gets the resource collection API of DatabaseMigrationsMongoToCosmosDbvCoreMongoes. + * + * @return Resource collection API of DatabaseMigrationsMongoToCosmosDbvCoreMongoes. + */ + public DatabaseMigrationsMongoToCosmosDbvCoreMongoes databaseMigrationsMongoToCosmosDbvCoreMongoes() { + if (this.databaseMigrationsMongoToCosmosDbvCoreMongoes == null) { + this.databaseMigrationsMongoToCosmosDbvCoreMongoes = new DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl( + clientObject.getDatabaseMigrationsMongoToCosmosDbvCoreMongoes(), this); + } + return databaseMigrationsMongoToCosmosDbvCoreMongoes; + } + + /** + * Gets the resource collection API of DatabaseMigrationsSqlDbs. It manages DatabaseMigrationSqlDb. + * + * @return Resource collection API of DatabaseMigrationsSqlDbs. + */ + public DatabaseMigrationsSqlDbs databaseMigrationsSqlDbs() { + if (this.databaseMigrationsSqlDbs == null) { + this.databaseMigrationsSqlDbs + = new DatabaseMigrationsSqlDbsImpl(clientObject.getDatabaseMigrationsSqlDbs(), this); + } + return databaseMigrationsSqlDbs; + } + + /** + * Gets the resource collection API of DatabaseMigrationsSqlMis. It manages DatabaseMigrationSqlMi. + * + * @return Resource collection API of DatabaseMigrationsSqlMis. + */ + public DatabaseMigrationsSqlMis databaseMigrationsSqlMis() { + if (this.databaseMigrationsSqlMis == null) { + this.databaseMigrationsSqlMis + = new DatabaseMigrationsSqlMisImpl(clientObject.getDatabaseMigrationsSqlMis(), this); + } + return databaseMigrationsSqlMis; + } + + /** + * Gets the resource collection API of DatabaseMigrationsSqlVms. It manages DatabaseMigrationSqlVm. + * + * @return Resource collection API of DatabaseMigrationsSqlVms. + */ + public DatabaseMigrationsSqlVms databaseMigrationsSqlVms() { + if (this.databaseMigrationsSqlVms == null) { + this.databaseMigrationsSqlVms + = new DatabaseMigrationsSqlVmsImpl(clientObject.getDatabaseMigrationsSqlVms(), this); + } + return databaseMigrationsSqlVms; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of MigrationServices. It manages MigrationService. + * + * @return Resource collection API of MigrationServices. + */ + public MigrationServices migrationServices() { + if (this.migrationServices == null) { + this.migrationServices = new MigrationServicesImpl(clientObject.getMigrationServices(), this); + } + return migrationServices; + } + + /** + * Gets the resource collection API of SqlMigrationServices. It manages SqlMigrationService. + * + * @return Resource collection API of SqlMigrationServices. + */ + public SqlMigrationServices sqlMigrationServices() { + if (this.sqlMigrationServices == null) { + this.sqlMigrationServices = new SqlMigrationServicesImpl(clientObject.getSqlMigrationServices(), this); + } + return sqlMigrationServices; + } + /** * Gets the resource collection API of ResourceSkus. * @@ -307,6 +452,18 @@ public Tasks tasks() { return tasks; } + /** + * Gets the resource collection API of ServiceTasks. + * + * @return Resource collection API of ServiceTasks. + */ + public ServiceTasks serviceTasks() { + if (this.serviceTasks == null) { + this.serviceTasks = new ServiceTasksImpl(clientObject.getServiceTasks(), this); + } + return serviceTasks; + } + /** * Gets the resource collection API of Projects. It manages Project. * @@ -332,15 +489,15 @@ public Usages usages() { } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of Files. It manages ProjectFile. * - * @return Resource collection API of Operations. + * @return Resource collection API of Files. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Files files() { + if (this.files == null) { + this.files = new FilesImpl(clientObject.getFiles(), this); } - return operations; + return files; } /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java index 54bfff00ebf7..5d60df5238fd 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 @@ -12,7 +12,7 @@ */ public interface DataMigrationManagementClient { /** - * Gets Identifier of the subscription. + * Gets Subscription ID that identifies an Azure subscription. * * @return the subscriptionId value. */ @@ -46,6 +46,62 @@ public interface DataMigrationManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the DatabaseMigrationsMongoToCosmosDbRUMongoesClient object to access its operations. + * + * @return the DatabaseMigrationsMongoToCosmosDbRUMongoesClient object. + */ + DatabaseMigrationsMongoToCosmosDbRUMongoesClient getDatabaseMigrationsMongoToCosmosDbRUMongoes(); + + /** + * Gets the DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient object to access its operations. + * + * @return the DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient object. + */ + DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient getDatabaseMigrationsMongoToCosmosDbvCoreMongoes(); + + /** + * Gets the DatabaseMigrationsSqlDbsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlDbsClient object. + */ + DatabaseMigrationsSqlDbsClient getDatabaseMigrationsSqlDbs(); + + /** + * Gets the DatabaseMigrationsSqlMisClient object to access its operations. + * + * @return the DatabaseMigrationsSqlMisClient object. + */ + DatabaseMigrationsSqlMisClient getDatabaseMigrationsSqlMis(); + + /** + * Gets the DatabaseMigrationsSqlVmsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlVmsClient object. + */ + DatabaseMigrationsSqlVmsClient getDatabaseMigrationsSqlVms(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the MigrationServicesClient object to access its operations. + * + * @return the MigrationServicesClient object. + */ + MigrationServicesClient getMigrationServices(); + + /** + * Gets the SqlMigrationServicesClient object to access its operations. + * + * @return the SqlMigrationServicesClient object. + */ + SqlMigrationServicesClient getSqlMigrationServices(); + /** * Gets the ResourceSkusClient object to access its operations. * @@ -67,6 +123,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. * @@ -82,9 +145,9 @@ public interface DataMigrationManagementClient { UsagesClient getUsages(); /** - * Gets the OperationsClient object to access its operations. + * Gets the FilesClient object to access its operations. * - * @return the OperationsClient object. + * @return the FilesClient object. */ - OperationsClient getOperations(); + FilesClient getFiles(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbRUMongoesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbRUMongoesClient.java new file mode 100644 index 000000000000..ca6f0d2050df --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbRUMongoesClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationsMongoToCosmosDbRUMongoesClient. + */ +public interface DatabaseMigrationsMongoToCosmosDbRUMongoesClient { + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context); + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner get(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getForScope(String resourceGroupName, String targetResourceName); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getForScope(String resourceGroupName, String targetResourceName, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient.java new file mode 100644 index 000000000000..d37a27f4f71d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient. + */ +public interface DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient { + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context); + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner get(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getForScope(String resourceGroupName, String targetResourceName); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getForScope(String resourceGroupName, String targetResourceName, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java new file mode 100644 index 000000000000..7598aa660bf2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlDbsClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlDbsClient. + */ +public interface DatabaseMigrationsSqlDbsClient { + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner get(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, + DatabaseMigrationSqlDbInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, DatabaseMigrationSqlDbInner parameters, + Context context); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner createOrUpdate(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + DatabaseMigrationSqlDbInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlDbInner createOrUpdate(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + DatabaseMigrationSqlDbInner parameters, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlDbInstanceName, + String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, + Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java new file mode 100644 index 000000000000..12e5f9fc878d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlMisClient.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlMisClient. + */ +public interface DatabaseMigrationsSqlMisClient { + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String managedInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner get(String resourceGroupName, String managedInstanceName, String targetDbName); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters, Context context); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner createOrUpdate(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters); + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlMiInner createOrUpdate(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters, Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java new file mode 100644 index 000000000000..cce900f332ca --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DatabaseMigrationsSqlVmsClient.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlVmsClient. + */ +public interface DatabaseMigrationsSqlVmsClient { + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters, Context context); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner createOrUpdate(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, DatabaseMigrationSqlVmInner parameters); + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatabaseMigrationSqlVmInner createOrUpdate(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, DatabaseMigrationSqlVmInner parameters, Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCancel(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCutover(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java new file mode 100644 index 000000000000..e9b8c04f67f7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java @@ -0,0 +1,276 @@ +// Copyright (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 { + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context); + + /** + * Get file information + * + * 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); + + /** + * Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String groupName, String serviceName, String projectName, + String fileName, ProjectFileInner parameters, Context context); + + /** + * Create a file resource + * + * 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); + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String groupName, String serviceName, String projectName, String fileName, + Context context); + + /** + * Delete file + * + * 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); + + /** + * Update a file + * + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String groupName, String serviceName, String projectName, + String fileName, ProjectFileInner parameters, Context context); + + /** + * Update a file + * + * 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); + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context); + + /** + * Request storage information for downloading the file content + * + * 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); + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWriteWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context); + + /** + * Request information for reading and writing file content. + * + * 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); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/MigrationServicesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/MigrationServicesClient.java new file mode 100644 index 000000000000..86ea71e3e9f9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/MigrationServicesClient.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.MigrationServiceUpdate; + +/** + * An instance of this class provides access to all the operations defined in MigrationServicesClient. + */ +public interface MigrationServicesClient { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String migrationServiceName, Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationServiceInner getByResourceGroup(String resourceGroupName, String migrationServiceName); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationServiceInner> beginCreateOrUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationServiceInner> beginCreateOrUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceInner parameters, Context context); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationServiceInner createOrUpdate(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationServiceInner createOrUpdate(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters, Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String migrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String migrationServiceName, + Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String migrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String migrationServiceName, Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationServiceInner> beginUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MigrationServiceInner> beginUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters, Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationServiceInner update(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigrationServiceInner update(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters, Context context); + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve all migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieve all migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations(String resourceGroupName, String migrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations(String resourceGroupName, String migrationServiceName, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java index 6e248f290036..161ee0fe37fe 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java @@ -8,35 +8,31 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; /** * An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java index 18e9cec0c0db..afc6e0fa47bd 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 @@ -29,7 +29,7 @@ public interface ProjectsClient { * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String groupName, String serviceName); + PagedIterable list(String groupName, String serviceName); /** * Get projects in a service @@ -46,7 +46,7 @@ public interface ProjectsClient { * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String groupName, String serviceName, Context context); + PagedIterable list(String groupName, String serviceName, Context context); /** * Create or update project diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java index cdc591fdb8a7..4890671c7f85 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java @@ -17,11 +17,11 @@ public interface ResourceSkusClient { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,13 +29,13 @@ public interface ResourceSkusClient { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @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 DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java new file mode 100644 index 000000000000..8fc04626f523 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 { + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName); + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String groupName, String serviceName, String taskName, String expand, + Context context); + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, + Context context); + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String groupName, String serviceName, String taskName, + Context context); + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); +} 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 9a37e9c5c42e..c4b0965c2351 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 @@ -22,13 +22,13 @@ */ public interface ServicesClient { /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -38,20 +38,20 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters); /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -62,20 +62,20 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -85,20 +85,20 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters); /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -109,17 +109,17 @@ DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -127,33 +127,33 @@ DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, D * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String groupName, String serviceName, Context context); /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -166,10 +166,10 @@ Response getByResourceGroupWithResponse(String groupN SyncPoller, Void> beginDelete(String groupName, String serviceName); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -185,10 +185,10 @@ SyncPoller, Void> beginDelete(String groupName, String serviceN Context context); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -200,10 +200,10 @@ SyncPoller, Void> beginDelete(String groupName, String serviceN void delete(String groupName, String serviceName); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -217,11 +217,12 @@ SyncPoller, Void> beginDelete(String groupName, String serviceN void delete(String groupName, String serviceName, Boolean deleteRunningTasks, Context context); /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -229,18 +230,19 @@ SyncPoller, Void> beginDelete(String groupName, String serviceN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters); /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -249,18 +251,19 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DataMigrationServiceInner> beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -268,17 +271,18 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters); /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -287,7 +291,7 @@ SyncPoller, DataMigrationServiceInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters, @@ -296,8 +300,8 @@ DataMigrationServiceInner update(String groupName, String serviceName, DataMigra /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -314,8 +318,8 @@ Response checkStatusWithResponse(String /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -330,8 +334,8 @@ Response checkStatusWithResponse(String /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -346,8 +350,8 @@ Response checkStatusWithResponse(String /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -363,8 +367,8 @@ Response checkStatusWithResponse(String /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -378,8 +382,8 @@ Response checkStatusWithResponse(String /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -394,9 +398,9 @@ Response checkStatusWithResponse(String /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -411,9 +415,9 @@ Response checkStatusWithResponse(String /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -429,9 +433,9 @@ Response checkStatusWithResponse(String /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -445,9 +449,9 @@ Response checkStatusWithResponse(String /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -462,8 +466,8 @@ Response checkStatusWithResponse(String /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -478,8 +482,8 @@ Response checkStatusWithResponse(String /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -507,7 +511,7 @@ Response checkStatusWithResponse(String * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response nestedCheckNameAvailabilityWithResponse(String groupName, + Response checkChildrenNameAvailabilityWithResponse(String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); /** @@ -524,14 +528,14 @@ Response nestedCheckNameAvailabilityWithResponse( * @return indicates whether a proposed resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityResponseInner nestedCheckNameAvailability(String groupName, String serviceName, + NameAvailabilityResponseInner checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters); /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -545,8 +549,8 @@ NameAvailabilityResponseInner nestedCheckNameAvailability(String groupName, Stri /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @param context The context to associate with this operation. @@ -561,8 +565,8 @@ NameAvailabilityResponseInner nestedCheckNameAvailability(String groupName, Stri /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -574,8 +578,8 @@ NameAvailabilityResponseInner nestedCheckNameAvailability(String groupName, Stri /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java new file mode 100644 index 000000000000..f13450720022 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/SqlMigrationServicesClient.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; + +/** + * An instance of this class provides access to all the operations defined in SqlMigrationServicesClient. + */ +public interface SqlMigrationServicesClient { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters, Context context); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner createOrUpdate(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters); + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner createOrUpdate(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName, + Context context); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginUpdate(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SqlMigrationServiceInner> beginUpdate(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters, Context context); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner update(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters); + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlMigrationServiceInner update(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, Context context); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAuthKeysWithResponse(String resourceGroupName, String sqlMigrationServiceName, + Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthenticationKeysInner listAuthKeys(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateAuthKeysWithResponse(String resourceGroupName, + String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegenAuthKeysInner regenerateAuthKeys(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteNodeWithResponse(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeleteNodeInner deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName, + Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listMonitoringDataWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeMonitoringDataInner listMonitoringData(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java index ff414c0c918e..554f3dcf1cd5 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; /** @@ -18,9 +19,9 @@ public interface TasksClient { /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -36,9 +37,9 @@ public interface TasksClient { /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -57,9 +58,9 @@ PagedIterable list(String groupName, String serviceName, Strin /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -79,9 +80,9 @@ Response createOrUpdateWithResponse(String groupName, String s /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -100,8 +101,8 @@ ProjectTaskInner createOrUpdate(String groupName, String serviceName, String pro /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -121,8 +122,8 @@ Response getWithResponse(String groupName, String serviceName, /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -139,8 +140,8 @@ Response getWithResponse(String groupName, String serviceName, /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -160,8 +161,8 @@ Response deleteWithResponse(String groupName, String serviceName, String p /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -177,9 +178,9 @@ Response deleteWithResponse(String groupName, String serviceName, String p /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -199,9 +200,9 @@ Response updateWithResponse(String groupName, String serviceNa /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -220,8 +221,8 @@ ProjectTaskInner update(String groupName, String serviceName, String projectName /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -240,8 +241,8 @@ Response cancelWithResponse(String groupName, String serviceNa /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -254,4 +255,45 @@ Response cancelWithResponse(String groupName, String serviceNa */ @ServiceMethod(returns = ReturnType.SINGLE) ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName); + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response commandWithResponse(String groupName, String serviceName, String projectName, + String taskName, CommandPropertiesInner parameters, Context context); + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPropertiesInner command(String groupName, String serviceName, String projectName, String taskName, + CommandPropertiesInner parameters); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java index 81e88f2dd07c..6f1d75b3f6f2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java @@ -17,7 +17,8 @@ public interface UsagesClient { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +32,8 @@ public interface UsagesClient { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @param context The context to associate with this operation. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java new file mode 100644 index 000000000000..46f0c1ea9c77 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AuthenticationKeysInner.java @@ -0,0 +1,121 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An authentication key. + */ +@Fluent +public final class AuthenticationKeysInner implements JsonSerializable { + /* + * The first authentication key. + */ + private String authKey1; + + /* + * The second authentication key. + */ + private String authKey2; + + /** + * Creates an instance of AuthenticationKeysInner class. + */ + public AuthenticationKeysInner() { + } + + /** + * Get the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + public String authKey1() { + return this.authKey1; + } + + /** + * Set the authKey1 property: The first authentication key. + * + * @param authKey1 the authKey1 value to set. + * @return the AuthenticationKeysInner object itself. + */ + public AuthenticationKeysInner withAuthKey1(String authKey1) { + this.authKey1 = authKey1; + return this; + } + + /** + * Get the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + public String authKey2() { + return this.authKey2; + } + + /** + * Set the authKey2 property: The second authentication key. + * + * @param authKey2 the authKey2 value to set. + * @return the AuthenticationKeysInner object itself. + */ + public AuthenticationKeysInner withAuthKey2(String authKey2) { + this.authKey2 = authKey2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authKey1", this.authKey1); + jsonWriter.writeStringField("authKey2", this.authKey2); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthenticationKeysInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthenticationKeysInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthenticationKeysInner. + */ + public static AuthenticationKeysInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthenticationKeysInner deserializedAuthenticationKeysInner = new AuthenticationKeysInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authKey1".equals(fieldName)) { + deserializedAuthenticationKeysInner.authKey1 = reader.getString(); + } else if ("authKey2".equals(fieldName)) { + deserializedAuthenticationKeysInner.authKey2 = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthenticationKeysInner; + }); + } +} 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 000000000000..2ea0bcda9652 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.CommandState; +import com.azure.resourcemanager.datamigration.models.CommandType; +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 java.io.IOException; +import java.util.List; + +/** + * Base class for all types of DMS (classic) command properties. If command is not supported by current client, this + * object is returned. + */ +@Immutable +public class CommandPropertiesInner implements JsonSerializable { + /* + * Command type. + */ + private CommandType commandType = CommandType.fromString("CommandProperties"); + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /** + * Creates an instance of CommandPropertiesInner class. + */ + public CommandPropertiesInner() { + } + + /** + * Get the commandType property: Command type. + * + * @return the commandType value. + */ + public CommandType commandType() { + return this.commandType; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: Array of errors. This is ignored if submitted. + * + * @param errors the errors value to set. + * @return the CommandPropertiesInner object itself. + */ + CommandPropertiesInner withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + public CommandState state() { + return this.state; + } + + /** + * Set the state property: The state of the command. This is ignored if submitted. + * + * @param state the state value to set. + * @return the CommandPropertiesInner object itself. + */ + CommandPropertiesInner withState(CommandState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandPropertiesInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CommandPropertiesInner. + */ + public static CommandPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("commandType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Migrate.Sync.Complete.Database".equals(discriminatorValue)) { + return MigrateSyncCompleteCommandProperties.fromJson(readerToUse.reset()); + } else if ("Migrate.SqlServer.AzureDbSqlMi.Complete".equals(discriminatorValue)) { + return MigrateMISyncCompleteCommandProperties.fromJson(readerToUse.reset()); + } else if ("cancel".equals(discriminatorValue)) { + return MongoDbCancelCommand.fromJson(readerToUse.reset()); + } else if ("finish".equals(discriminatorValue)) { + return MongoDbFinishCommand.fromJson(readerToUse.reset()); + } else if ("restart".equals(discriminatorValue)) { + return MongoDbRestartCommand.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CommandPropertiesInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandPropertiesInner deserializedCommandPropertiesInner = new CommandPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commandType".equals(fieldName)) { + deserializedCommandPropertiesInner.commandType = CommandType.fromString(reader.getString()); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedCommandPropertiesInner.errors = errors; + } else if ("state".equals(fieldName)) { + deserializedCommandPropertiesInner.state = CommandState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandPropertiesInner; + }); + } +} 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 e37c767885c0..f3ddf12315a3 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 @@ -11,11 +11,12 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; import com.azure.resourcemanager.datamigration.models.ServiceSku; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; import java.io.IOException; import java.util.Map; /** - * A Database Migration Service resource. + * An Azure Database Migration Service (classic) resource. */ @Fluent public final class DataMigrationServiceInner extends Resource { @@ -39,6 +40,11 @@ public final class DataMigrationServiceInner extends Resource { */ private ServiceSku sku; + /* + * The systemData property. + */ + private SystemDataAutoGenerated systemData; + /* * The type of the resource. */ @@ -129,6 +135,15 @@ public DataMigrationServiceInner withSku(ServiceSku sku) { return this; } + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -234,6 +249,77 @@ 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.innerProperties() == null ? null : this.innerProperties().virtualNicId(); + } + + /** + * Set the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @param virtualNicId the virtualNicId value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualNicId(String virtualNicId) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withVirtualNicId(virtualNicId); + return this; + } + + /** + * Get the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @return the autoStopDelay value. + */ + public String autoStopDelay() { + return this.innerProperties() == null ? null : this.innerProperties().autoStopDelay(); + } + + /** + * Set the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @param autoStopDelay the autoStopDelay value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withAutoStopDelay(String autoStopDelay) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withAutoStopDelay(autoStopDelay); + return this; + } + + /** + * Get the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @return the deleteResourcesOnStop value. + */ + public Boolean deleteResourcesOnStop() { + return this.innerProperties() == null ? null : this.innerProperties().deleteResourcesOnStop(); + } + + /** + * Set the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @param deleteResourcesOnStop the deleteResourcesOnStop value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withDeleteResourcesOnStop(Boolean deleteResourcesOnStop) { + if (this.innerProperties() == null) { + this.innerProperties = new DataMigrationServiceProperties(); + } + this.innerProperties().withDeleteResourcesOnStop(deleteResourcesOnStop); + return this; + } + /** * Validates the instance. * @@ -246,6 +332,9 @@ public void validate() { if (sku() != null) { sku().validate(); } + if (systemData() != null) { + systemData().validate(); + } } /** @@ -299,6 +388,8 @@ public static DataMigrationServiceInner fromJson(JsonReader jsonReader) throws I = DataMigrationServiceProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedDataMigrationServiceInner.sku = ServiceSku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataMigrationServiceInner.systemData = SystemDataAutoGenerated.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java index 6d1ef23c616f..87bececc7b3f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceProperties.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.datamigration.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +13,7 @@ import java.io.IOException; /** - * Properties of the Data Migration service instance. + * Properties of the Azure Database Migration Service (classic) instance. */ @Fluent public final class DataMigrationServiceProperties implements JsonSerializable { @@ -33,6 +32,21 @@ public final class DataMigrationServiceProperties implements JsonSerializable { + DatabaseMigrationBaseInner deserializedDatabaseMigrationBaseInner = new DatabaseMigrationBaseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationBaseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationBaseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationBaseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationBaseInner.properties + = DatabaseMigrationBaseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationBaseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationBaseInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationCosmosDbMongoInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationCosmosDbMongoInner.java new file mode 100644 index 000000000000..171195dda20e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationCosmosDbMongoInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; +import java.io.IOException; + +/** + * Database Migration Resource for Mongo to CosmosDb. + */ +@Fluent +public final class DatabaseMigrationCosmosDbMongoInner extends ProxyResource { + /* + * Database Migration Resource properties for CosmosDb for Mongo. + */ + private DatabaseMigrationPropertiesCosmosDbMongo properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationCosmosDbMongoInner class. + */ + public DatabaseMigrationCosmosDbMongoInner() { + } + + /** + * Get the properties property: Database Migration Resource properties for CosmosDb for Mongo. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesCosmosDbMongo properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for CosmosDb for Mongo. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationCosmosDbMongoInner object itself. + */ + public DatabaseMigrationCosmosDbMongoInner withProperties(DatabaseMigrationPropertiesCosmosDbMongo properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationCosmosDbMongoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationCosmosDbMongoInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationCosmosDbMongoInner. + */ + public static DatabaseMigrationCosmosDbMongoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationCosmosDbMongoInner deserializedDatabaseMigrationCosmosDbMongoInner + = new DatabaseMigrationCosmosDbMongoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoInner.properties + = DatabaseMigrationPropertiesCosmosDbMongo.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationCosmosDbMongoInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java new file mode 100644 index 000000000000..e75053d47301 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationProperties; +import java.io.IOException; + +/** + * Database Migration Resource. + */ +@Fluent +public final class DatabaseMigrationInner extends ProxyResource { + /* + * Database Migration Resource properties. + */ + private DatabaseMigrationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationInner class. + */ + public DatabaseMigrationInner() { + } + + /** + * Get the properties property: Database Migration Resource properties. + * + * @return the properties value. + */ + public DatabaseMigrationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationInner object itself. + */ + public DatabaseMigrationInner withProperties(DatabaseMigrationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationInner. + */ + public static DatabaseMigrationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationInner deserializedDatabaseMigrationInner = new DatabaseMigrationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationInner.properties = DatabaseMigrationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java new file mode 100644 index 000000000000..7874ac4f3fc7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlDbInner.java @@ -0,0 +1,170 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.io.IOException; + +/** + * Database Migration Resource for SQL Database. + */ +@Fluent +public final class DatabaseMigrationSqlDbInner extends ProxyResource { + /* + * Database Migration Resource properties for SQL database. + */ + private DatabaseMigrationPropertiesSqlDb properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemDataAutoGenerated systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationSqlDbInner class. + */ + public DatabaseMigrationSqlDbInner() { + } + + /** + * Get the properties property: Database Migration Resource properties for SQL database. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlDb properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL database. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlDbInner object itself. + */ + public DatabaseMigrationSqlDbInner withProperties(DatabaseMigrationPropertiesSqlDb properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationSqlDbInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationSqlDbInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationSqlDbInner. + */ + public static DatabaseMigrationSqlDbInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationSqlDbInner deserializedDatabaseMigrationSqlDbInner = new DatabaseMigrationSqlDbInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationSqlDbInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationSqlDbInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationSqlDbInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationSqlDbInner.properties + = DatabaseMigrationPropertiesSqlDb.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationSqlDbInner.systemData = SystemDataAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationSqlDbInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java new file mode 100644 index 000000000000..b9d5a33fda03 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlMiInner.java @@ -0,0 +1,170 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.io.IOException; + +/** + * Database Migration Resource for SQL Managed Instance. + */ +@Fluent +public final class DatabaseMigrationSqlMiInner extends ProxyResource { + /* + * Database Migration Resource properties for SQL Managed Instance. + */ + private DatabaseMigrationPropertiesSqlMi properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemDataAutoGenerated systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationSqlMiInner class. + */ + public DatabaseMigrationSqlMiInner() { + } + + /** + * Get the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlMi properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlMiInner object itself. + */ + public DatabaseMigrationSqlMiInner withProperties(DatabaseMigrationPropertiesSqlMi properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationSqlMiInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationSqlMiInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationSqlMiInner. + */ + public static DatabaseMigrationSqlMiInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationSqlMiInner deserializedDatabaseMigrationSqlMiInner = new DatabaseMigrationSqlMiInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationSqlMiInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationSqlMiInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationSqlMiInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationSqlMiInner.properties + = DatabaseMigrationPropertiesSqlMi.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationSqlMiInner.systemData = SystemDataAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationSqlMiInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java new file mode 100644 index 000000000000..8730887b7613 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DatabaseMigrationSqlVmInner.java @@ -0,0 +1,170 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.io.IOException; + +/** + * Database Migration Resource for SQL Virtual Machine. + */ +@Fluent +public final class DatabaseMigrationSqlVmInner extends ProxyResource { + /* + * Database Migration Resource properties for SQL Virtual Machine. + */ + private DatabaseMigrationPropertiesSqlVm properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemDataAutoGenerated systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DatabaseMigrationSqlVmInner class. + */ + public DatabaseMigrationSqlVmInner() { + } + + /** + * Get the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @return the properties value. + */ + public DatabaseMigrationPropertiesSqlVm properties() { + return this.properties; + } + + /** + * Set the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @param properties the properties value to set. + * @return the DatabaseMigrationSqlVmInner object itself. + */ + public DatabaseMigrationSqlVmInner withProperties(DatabaseMigrationPropertiesSqlVm properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationSqlVmInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationSqlVmInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatabaseMigrationSqlVmInner. + */ + public static DatabaseMigrationSqlVmInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationSqlVmInner deserializedDatabaseMigrationSqlVmInner = new DatabaseMigrationSqlVmInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDatabaseMigrationSqlVmInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatabaseMigrationSqlVmInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDatabaseMigrationSqlVmInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseMigrationSqlVmInner.properties + = DatabaseMigrationPropertiesSqlVm.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDatabaseMigrationSqlVmInner.systemData = SystemDataAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationSqlVmInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java new file mode 100644 index 000000000000..e07275804804 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DeleteNodeInner.java @@ -0,0 +1,121 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of node to be deleted. + */ +@Fluent +public final class DeleteNodeInner implements JsonSerializable { + /* + * The name of node to delete. + */ + private String nodeName; + + /* + * The name of integration runtime. + */ + private String integrationRuntimeName; + + /** + * Creates an instance of DeleteNodeInner class. + */ + public DeleteNodeInner() { + } + + /** + * Get the nodeName property: The name of node to delete. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Set the nodeName property: The name of node to delete. + * + * @param nodeName the nodeName value to set. + * @return the DeleteNodeInner object itself. + */ + public DeleteNodeInner withNodeName(String nodeName) { + this.nodeName = nodeName; + return this; + } + + /** + * Get the integrationRuntimeName property: The name of integration runtime. + * + * @return the integrationRuntimeName value. + */ + public String integrationRuntimeName() { + return this.integrationRuntimeName; + } + + /** + * Set the integrationRuntimeName property: The name of integration runtime. + * + * @param integrationRuntimeName the integrationRuntimeName value to set. + * @return the DeleteNodeInner object itself. + */ + public DeleteNodeInner withIntegrationRuntimeName(String integrationRuntimeName) { + this.integrationRuntimeName = integrationRuntimeName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nodeName", this.nodeName); + jsonWriter.writeStringField("integrationRuntimeName", this.integrationRuntimeName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteNodeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteNodeInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeleteNodeInner. + */ + public static DeleteNodeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteNodeInner deserializedDeleteNodeInner = new DeleteNodeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nodeName".equals(fieldName)) { + deserializedDeleteNodeInner.nodeName = reader.getString(); + } else if ("integrationRuntimeName".equals(fieldName)) { + deserializedDeleteNodeInner.integrationRuntimeName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteNodeInner; + }); + } +} 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 000000000000..1fafe782bf5a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * File storage information. + */ +@Fluent +public final class FileStorageInfoInner implements JsonSerializable { + /* + * A URI that can be used to access the file content. + */ + private String uri; + + /* + * Dictionary of + */ + private Map headers; + + /** + * Creates an instance of FileStorageInfoInner class. + */ + public FileStorageInfoInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileStorageInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileStorageInfoInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FileStorageInfoInner. + */ + public static FileStorageInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileStorageInfoInner deserializedFileStorageInfoInner = new FileStorageInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedFileStorageInfoInner.uri = reader.getString(); + } else if ("headers".equals(fieldName)) { + Map headers = reader.readMap(reader1 -> reader1.getString()); + deserializedFileStorageInfoInner.headers = headers; + } else { + reader.skipChildren(); + } + } + + return deserializedFileStorageInfoInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.java new file mode 100644 index 000000000000..460a86ef7743 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/IntegrationRuntimeMonitoringDataInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.NodeMonitoringData; +import java.io.IOException; +import java.util.List; + +/** + * Integration Runtime Monitoring Data. + */ +@Immutable +public final class IntegrationRuntimeMonitoringDataInner + implements JsonSerializable { + /* + * The name of Integration Runtime. + */ + private String name; + + /* + * Integration Runtime node monitoring data. + */ + private List nodes; + + /** + * Creates an instance of IntegrationRuntimeMonitoringDataInner class. + */ + public IntegrationRuntimeMonitoringDataInner() { + } + + /** + * Get the name property: The name of Integration Runtime. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the nodes property: Integration Runtime node monitoring data. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IntegrationRuntimeMonitoringDataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IntegrationRuntimeMonitoringDataInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IntegrationRuntimeMonitoringDataInner. + */ + public static IntegrationRuntimeMonitoringDataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IntegrationRuntimeMonitoringDataInner deserializedIntegrationRuntimeMonitoringDataInner + = new IntegrationRuntimeMonitoringDataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIntegrationRuntimeMonitoringDataInner.name = reader.getString(); + } else if ("nodes".equals(fieldName)) { + List nodes = reader.readArray(reader1 -> NodeMonitoringData.fromJson(reader1)); + deserializedIntegrationRuntimeMonitoringDataInner.nodes = nodes; + } else { + reader.skipChildren(); + } + } + + return deserializedIntegrationRuntimeMonitoringDataInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceInner.java new file mode 100644 index 000000000000..bcebd3188a0b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceInner.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * A Migration Service. + */ +@Fluent +public final class MigrationServiceInner extends Resource { + /* + * The Migration Service properties. + */ + private MigrationServiceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MigrationServiceInner class. + */ + public MigrationServiceInner() { + } + + /** + * Get the innerProperties property: The Migration Service properties. + * + * @return the innerProperties value. + */ + private MigrationServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrationServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrationServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.innerProperties() == null ? null : this.innerProperties().integrationRuntimeState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationServiceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrationServiceInner. + */ + public static MigrationServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationServiceInner deserializedMigrationServiceInner = new MigrationServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrationServiceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMigrationServiceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMigrationServiceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMigrationServiceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrationServiceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedMigrationServiceInner.innerProperties = MigrationServiceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMigrationServiceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationServiceInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceProperties.java new file mode 100644 index 000000000000..1f17cc5fc524 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/MigrationServiceProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.ProvisioningState; +import java.io.IOException; + +/** + * The Migration Service properties. + */ +@Immutable +public final class MigrationServiceProperties implements JsonSerializable { + /* + * Provisioning state to track the async operation status. + */ + private ProvisioningState provisioningState; + + /* + * Current state of the Integration runtime. + */ + private String integrationRuntimeState; + + /** + * Creates an instance of MigrationServiceProperties class. + */ + public MigrationServiceProperties() { + } + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.integrationRuntimeState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationServiceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationServiceProperties. + */ + public static MigrationServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationServiceProperties deserializedMigrationServiceProperties = new MigrationServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedMigrationServiceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("integrationRuntimeState".equals(fieldName)) { + deserializedMigrationServiceProperties.integrationRuntimeState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationServiceProperties; + }); + } +} 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 536e3e704cae..306fb6b34f75 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Indicates whether a proposed resource name is available. */ -@Immutable +@Fluent public final class NameAvailabilityResponseInner implements JsonSerializable { /* * If true, the name is valid and available. If false, 'reason' describes why not. @@ -47,6 +47,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. * @@ -56,6 +67,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. * @@ -65,6 +87,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. * @@ -79,6 +112,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java new file mode 100644 index 000000000000..b3a3d44c593e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/OperationsDefinitionInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.OperationOrigin; +import com.azure.resourcemanager.datamigration.models.OperationsDisplayDefinition; +import java.io.IOException; +import java.util.Map; + +/** + * The OperationsDefinition model. + */ +@Fluent +public final class OperationsDefinitionInner implements JsonSerializable { + /* + * The name property. + */ + private String name; + + /* + * Indicates whether the operation is a data action + */ + private Boolean isDataAction; + + /* + * The display property. + */ + private OperationsDisplayDefinition display; + + /* + * The origin property. + */ + private OperationOrigin origin; + + /* + * Dictionary of + */ + private Map properties; + + /** + * Creates an instance of OperationsDefinitionInner class. + */ + public OperationsDefinitionInner() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationsDefinitionInner object itself. + */ + public OperationsDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The display property. + * + * @return the display value. + */ + public OperationsDisplayDefinition display() { + return this.display; + } + + /** + * Get the origin property: The origin property. + * + * @return the origin value. + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Get the properties property: Dictionary of <AnyObject>. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationsDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationsDefinitionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationsDefinitionInner. + */ + public static OperationsDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationsDefinitionInner deserializedOperationsDefinitionInner = new OperationsDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationsDefinitionInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationsDefinitionInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationsDefinitionInner.display = OperationsDisplayDefinition.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationsDefinitionInner.origin = OperationOrigin.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + Map properties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedOperationsDefinitionInner.properties = properties; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationsDefinitionInner; + }); + } +} 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 000000000000..86e2a509350a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java @@ -0,0 +1,197 @@ +// Copyright (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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.io.IOException; + +/** + * A file resource. + */ +@Fluent +public final class ProjectFileInner extends ProxyResource { + /* + * HTTP strong entity tag value. This is ignored if submitted. + */ + private String etag; + + /* + * Custom file properties + */ + private ProjectFileProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemDataAutoGenerated systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProjectFileInner class. + */ + public ProjectFileInner() { + } + + /** + * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties property: Custom file properties. + * + * @return the properties value. + */ + public ProjectFileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Custom file properties. + * + * @param properties the properties value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withProperties(ProjectFileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectFileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectFileInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProjectFileInner. + */ + public static ProjectFileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectFileInner deserializedProjectFileInner = new ProjectFileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProjectFileInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectFileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectFileInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedProjectFileInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProjectFileInner.properties = ProjectFileProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectFileInner.systemData = SystemDataAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectFileInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java index 54542635645d..79f9ccbab62e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java @@ -9,11 +9,13 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; import com.azure.resourcemanager.datamigration.models.ConnectionInfo; import com.azure.resourcemanager.datamigration.models.DatabaseInfo; import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -29,6 +31,16 @@ public final class ProjectInner extends Resource { */ private ProjectProperties innerProperties; + /* + * HTTP strong entity tag value. This is ignored if submitted. + */ + private String etag; + + /* + * The systemData property. + */ + private SystemDataAutoGenerated systemData; + /* * The type of the resource. */ @@ -59,6 +71,35 @@ private ProjectProperties innerProperties() { return this.innerProperties; } + /** + * 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 ProjectInner object itself. + */ + public ProjectInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -130,6 +171,31 @@ public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { return this; } + /** + * Get the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @return the azureAuthenticationInfo value. + */ + public AzureActiveDirectoryApp azureAuthenticationInfo() { + return this.innerProperties() == null ? null : this.innerProperties().azureAuthenticationInfo(); + } + + /** + * Set the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * + * @param azureAuthenticationInfo the azureAuthenticationInfo value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new ProjectProperties(); + } + this.innerProperties().withAzureAuthenticationInfo(azureAuthenticationInfo); + return this; + } + /** * Get the targetPlatform property: Target platform for the project. * @@ -249,6 +315,9 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (systemData() != null) { + systemData().validate(); + } } /** @@ -260,6 +329,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -292,6 +362,10 @@ public static ProjectInner fromJson(JsonReader jsonReader) throws IOException { deserializedProjectInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedProjectInner.innerProperties = ProjectProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedProjectInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedProjectInner.systemData = SystemDataAutoGenerated.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java index f296bd03a423..bfeed31af6de 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectProperties.java @@ -11,6 +11,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; import com.azure.resourcemanager.datamigration.models.ConnectionInfo; import com.azure.resourcemanager.datamigration.models.DatabaseInfo; import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; @@ -30,6 +31,11 @@ public final class ProjectProperties implements JsonSerializable writer.writeJson(element)); @@ -249,6 +281,8 @@ public static ProjectProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedProjectProperties.sourcePlatform = ProjectSourcePlatform.fromString(reader.getString()); } else if ("targetPlatform".equals(fieldName)) { deserializedProjectProperties.targetPlatform = ProjectTargetPlatform.fromString(reader.getString()); + } else if ("azureAuthenticationInfo".equals(fieldName)) { + deserializedProjectProperties.azureAuthenticationInfo = AzureActiveDirectoryApp.fromJson(reader); } else if ("creationTime".equals(fieldName)) { deserializedProjectProperties.creationTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java index 9b01d6a568ae..049bd7eb132f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; import java.io.IOException; /** @@ -27,6 +28,11 @@ public final class ProjectTaskInner extends ProxyResource { */ private ProjectTaskProperties properties; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemDataAutoGenerated systemData; + /* * The type of the resource. */ @@ -88,6 +94,15 @@ public ProjectTaskInner withProperties(ProjectTaskProperties properties) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -127,6 +142,9 @@ public void validate() { if (properties() != null) { properties().validate(); } + if (systemData() != null) { + systemData().validate(); + } } /** @@ -166,6 +184,8 @@ public static ProjectTaskInner fromJson(JsonReader jsonReader) throws IOExceptio deserializedProjectTaskInner.etag = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedProjectTaskInner.properties = ProjectTaskProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectTaskInner.systemData = SystemDataAutoGenerated.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.java new file mode 100644 index 000000000000..09e5b13e9117 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/RegenAuthKeysInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An authentication key to regenerate. + */ +@Fluent +public final class RegenAuthKeysInner implements JsonSerializable { + /* + * The name of authentication key to generate. + */ + private String keyName; + + /* + * The first authentication key. + */ + private String authKey1; + + /* + * The second authentication key. + */ + private String authKey2; + + /** + * Creates an instance of RegenAuthKeysInner class. + */ + public RegenAuthKeysInner() { + } + + /** + * Get the keyName property: The name of authentication key to generate. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of authentication key to generate. + * + * @param keyName the keyName value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + public String authKey1() { + return this.authKey1; + } + + /** + * Set the authKey1 property: The first authentication key. + * + * @param authKey1 the authKey1 value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withAuthKey1(String authKey1) { + this.authKey1 = authKey1; + return this; + } + + /** + * Get the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + public String authKey2() { + return this.authKey2; + } + + /** + * Set the authKey2 property: The second authentication key. + * + * @param authKey2 the authKey2 value to set. + * @return the RegenAuthKeysInner object itself. + */ + public RegenAuthKeysInner withAuthKey2(String authKey2) { + this.authKey2 = authKey2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("authKey1", this.authKey1); + jsonWriter.writeStringField("authKey2", this.authKey2); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegenAuthKeysInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegenAuthKeysInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegenAuthKeysInner. + */ + public static RegenAuthKeysInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegenAuthKeysInner deserializedRegenAuthKeysInner = new RegenAuthKeysInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedRegenAuthKeysInner.keyName = reader.getString(); + } else if ("authKey1".equals(fieldName)) { + deserializedRegenAuthKeysInner.authKey1 = reader.getString(); + } else if ("authKey2".equals(fieldName)) { + deserializedRegenAuthKeysInner.authKey2 = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegenAuthKeysInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java index a4b9bfce12f1..5b2bb800166a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java @@ -17,7 +17,7 @@ import java.util.List; /** - * Describes an available DMS SKU. + * Describes an available DMS (classic) SKU. */ @Immutable public final class ResourceSkuInner implements JsonSerializable { @@ -32,7 +32,7 @@ public final class ResourceSkuInner implements JsonSerializable { - /* - * The fully qualified action name, e.g. Microsoft.DataMigration/services/read - */ - private String name; - - /* - * Localized display text - */ - private ServiceOperationDisplay display; - - /** - * Creates an instance of ServiceOperationInner class. - */ - public ServiceOperationInner() { - } - - /** - * Get the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @param name the name value to set. - * @return the ServiceOperationInner object itself. - */ - public ServiceOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Localized display text. - * - * @return the display value. - */ - public ServiceOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display text. - * - * @param display the display value to set. - * @return the ServiceOperationInner object itself. - */ - public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceOperationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceOperationInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServiceOperationInner. - */ - public static ServiceOperationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceOperationInner deserializedServiceOperationInner = new ServiceOperationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedServiceOperationInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedServiceOperationInner.display = ServiceOperationDisplay.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServiceOperationInner; - }); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java new file mode 100644 index 000000000000..02bd10675f20 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceInner.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.io.IOException; +import java.util.Map; + +/** + * A SQL Migration Service. + */ +@Fluent +public final class SqlMigrationServiceInner extends Resource { + /* + * The SQL Migration Service properties. + */ + private SqlMigrationServiceProperties innerProperties; + + /* + * The systemData property. + */ + private SystemDataAutoGenerated systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SqlMigrationServiceInner class. + */ + public SqlMigrationServiceInner() { + } + + /** + * Get the innerProperties property: The SQL Migration Service properties. + * + * @return the innerProperties value. + */ + private SqlMigrationServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The systemData property. + * + * @return the systemData value. + */ + public SystemDataAutoGenerated systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public SqlMigrationServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SqlMigrationServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.innerProperties() == null ? null : this.innerProperties().integrationRuntimeState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (systemData() != null) { + systemData().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMigrationServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMigrationServiceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SqlMigrationServiceInner. + */ + public static SqlMigrationServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMigrationServiceInner deserializedSqlMigrationServiceInner = new SqlMigrationServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSqlMigrationServiceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSqlMigrationServiceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSqlMigrationServiceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSqlMigrationServiceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlMigrationServiceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSqlMigrationServiceInner.innerProperties + = SqlMigrationServiceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlMigrationServiceInner.systemData = SystemDataAutoGenerated.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMigrationServiceInner; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java new file mode 100644 index 000000000000..86cbf36bb04f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/SqlMigrationServiceProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SQL Migration Service properties. + */ +@Immutable +public final class SqlMigrationServiceProperties implements JsonSerializable { + /* + * Provisioning state to track the async operation status. + */ + private String provisioningState; + + /* + * Current state of the Integration runtime. + */ + private String integrationRuntimeState; + + /** + * Creates an instance of SqlMigrationServiceProperties class. + */ + public SqlMigrationServiceProperties() { + } + + /** + * Get the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + public String integrationRuntimeState() { + return this.integrationRuntimeState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMigrationServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMigrationServiceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlMigrationServiceProperties. + */ + public static SqlMigrationServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMigrationServiceProperties deserializedSqlMigrationServiceProperties + = new SqlMigrationServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSqlMigrationServiceProperties.provisioningState = reader.getString(); + } else if ("integrationRuntimeState".equals(fieldName)) { + deserializedSqlMigrationServiceProperties.integrationRuntimeState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMigrationServiceProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java similarity index 52% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java index ef33040ec7a5..46ac6e015c56 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AuthenticationKeysImpl.java @@ -4,30 +4,29 @@ package com.azure.resourcemanager.datamigration.implementation; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperation; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; -public final class ServiceOperationImpl implements ServiceOperation { - private ServiceOperationInner innerObject; +public final class AuthenticationKeysImpl implements AuthenticationKeys { + private AuthenticationKeysInner innerObject; private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; - ServiceOperationImpl(ServiceOperationInner innerObject, + AuthenticationKeysImpl(AuthenticationKeysInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String name() { - return this.innerModel().name(); + public String authKey1() { + return this.innerModel().authKey1(); } - public ServiceOperationDisplay display() { - return this.innerModel().display(); + public String authKey2() { + return this.innerModel().authKey2(); } - public ServiceOperationInner innerModel() { + public AuthenticationKeysInner innerModel() { return this.innerObject; } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java new file mode 100644 index 000000000000..81e7bd05a132 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.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.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 com.azure.resourcemanager.datamigration.models.CommandType; +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 CommandType commandType() { + return this.innerModel().commandType(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CommandState state() { + return this.innerModel().state(); + } + + public CommandPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java index ae8a9cfddf4b..5f9d276d2616 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { DataMigrationManagementClientImpl.class }) public final class DataMigrationManagementClientBuilder { /* - * Identifier of the subscription + * Subscription ID that identifies an Azure subscription. */ private String subscriptionId; /** - * Sets Identifier of the subscription. + * Sets Subscription ID that identifies an Azure subscription. * * @param subscriptionId the subscriptionId value. * @return the DataMigrationManagementClientBuilder. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java index 3fcb611da664..bc8242a8f3e2 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 @@ -24,10 +24,19 @@ 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.DatabaseMigrationsMongoToCosmosDbRUMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.MigrationServicesClient; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; import com.azure.resourcemanager.datamigration.fluent.ProjectsClient; import com.azure.resourcemanager.datamigration.fluent.ResourceSkusClient; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; import com.azure.resourcemanager.datamigration.fluent.ServicesClient; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; import com.azure.resourcemanager.datamigration.fluent.TasksClient; import com.azure.resourcemanager.datamigration.fluent.UsagesClient; import java.io.IOException; @@ -45,12 +54,12 @@ @ServiceClient(builder = DataMigrationManagementClientBuilder.class) public final class DataMigrationManagementClientImpl implements DataMigrationManagementClient { /** - * Identifier of the subscription. + * Subscription ID that identifies an Azure subscription. */ private final String subscriptionId; /** - * Gets Identifier of the subscription. + * Gets Subscription ID that identifies an Azure subscription. * * @return the subscriptionId value. */ @@ -128,6 +137,118 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The DatabaseMigrationsMongoToCosmosDbRUMongoesClient object to access its operations. + */ + private final DatabaseMigrationsMongoToCosmosDbRUMongoesClient databaseMigrationsMongoToCosmosDbRUMongoes; + + /** + * Gets the DatabaseMigrationsMongoToCosmosDbRUMongoesClient object to access its operations. + * + * @return the DatabaseMigrationsMongoToCosmosDbRUMongoesClient object. + */ + public DatabaseMigrationsMongoToCosmosDbRUMongoesClient getDatabaseMigrationsMongoToCosmosDbRUMongoes() { + return this.databaseMigrationsMongoToCosmosDbRUMongoes; + } + + /** + * The DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient object to access its operations. + */ + private final DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient databaseMigrationsMongoToCosmosDbvCoreMongoes; + + /** + * Gets the DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient object to access its operations. + * + * @return the DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient object. + */ + public DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient getDatabaseMigrationsMongoToCosmosDbvCoreMongoes() { + return this.databaseMigrationsMongoToCosmosDbvCoreMongoes; + } + + /** + * The DatabaseMigrationsSqlDbsClient object to access its operations. + */ + private final DatabaseMigrationsSqlDbsClient databaseMigrationsSqlDbs; + + /** + * Gets the DatabaseMigrationsSqlDbsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlDbsClient object. + */ + public DatabaseMigrationsSqlDbsClient getDatabaseMigrationsSqlDbs() { + return this.databaseMigrationsSqlDbs; + } + + /** + * The DatabaseMigrationsSqlMisClient object to access its operations. + */ + private final DatabaseMigrationsSqlMisClient databaseMigrationsSqlMis; + + /** + * Gets the DatabaseMigrationsSqlMisClient object to access its operations. + * + * @return the DatabaseMigrationsSqlMisClient object. + */ + public DatabaseMigrationsSqlMisClient getDatabaseMigrationsSqlMis() { + return this.databaseMigrationsSqlMis; + } + + /** + * The DatabaseMigrationsSqlVmsClient object to access its operations. + */ + private final DatabaseMigrationsSqlVmsClient databaseMigrationsSqlVms; + + /** + * Gets the DatabaseMigrationsSqlVmsClient object to access its operations. + * + * @return the DatabaseMigrationsSqlVmsClient object. + */ + public DatabaseMigrationsSqlVmsClient getDatabaseMigrationsSqlVms() { + return this.databaseMigrationsSqlVms; + } + + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * The MigrationServicesClient object to access its operations. + */ + private final MigrationServicesClient migrationServices; + + /** + * Gets the MigrationServicesClient object to access its operations. + * + * @return the MigrationServicesClient object. + */ + public MigrationServicesClient getMigrationServices() { + return this.migrationServices; + } + + /** + * The SqlMigrationServicesClient object to access its operations. + */ + private final SqlMigrationServicesClient sqlMigrationServices; + + /** + * Gets the SqlMigrationServicesClient object to access its operations. + * + * @return the SqlMigrationServicesClient object. + */ + public SqlMigrationServicesClient getSqlMigrationServices() { + return this.sqlMigrationServices; + } + /** * The ResourceSkusClient object to access its operations. */ @@ -170,6 +291,20 @@ 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. */ @@ -199,17 +334,17 @@ public UsagesClient getUsages() { } /** - * The OperationsClient object to access its operations. + * The FilesClient object to access its operations. */ - private final OperationsClient operations; + private final FilesClient files; /** - * Gets the OperationsClient object to access its operations. + * Gets the FilesClient object to access its operations. * - * @return the OperationsClient object. + * @return the FilesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public FilesClient getFiles() { + return this.files; } /** @@ -219,7 +354,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId Identifier of the subscription. + * @param subscriptionId Subscription ID that identifies an Azure subscription. * @param endpoint server parameter. */ DataMigrationManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -229,13 +364,24 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-04-19"; + this.apiVersion = "2025-03-15-preview"; + this.databaseMigrationsMongoToCosmosDbRUMongoes + = new DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl(this); + this.databaseMigrationsMongoToCosmosDbvCoreMongoes + = new DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl(this); + this.databaseMigrationsSqlDbs = new DatabaseMigrationsSqlDbsClientImpl(this); + this.databaseMigrationsSqlMis = new DatabaseMigrationsSqlMisClientImpl(this); + this.databaseMigrationsSqlVms = new DatabaseMigrationsSqlVmsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.migrationServices = new MigrationServicesClientImpl(this); + this.sqlMigrationServices = new SqlMigrationServicesClientImpl(this); this.resourceSkus = new ResourceSkusClientImpl(this); this.services = new ServicesClientImpl(this); this.tasks = new TasksClientImpl(this); + this.serviceTasks = new ServiceTasksClientImpl(this); this.projects = new ProjectsClientImpl(this); this.usages = new UsagesClientImpl(this); - this.operations = new OperationsClientImpl(this); + this.files = new FilesClientImpl(this); } /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java index 02e68ee73a08..93a2c80b1093 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 @@ -14,6 +14,7 @@ import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; import com.azure.resourcemanager.datamigration.models.ServiceSku; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; import java.util.Collections; import java.util.Map; @@ -60,6 +61,10 @@ public ServiceSku sku() { return this.innerModel().sku(); } + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + public ServiceProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -72,6 +77,18 @@ public String virtualSubnetId() { return this.innerModel().virtualSubnetId(); } + public String virtualNicId() { + return this.innerModel().virtualNicId(); + } + + public String autoStopDelay() { + return this.innerModel().autoStopDelay(); + } + + public Boolean deleteResourcesOnStop() { + return this.innerModel().deleteResourcesOnStop(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -187,13 +204,13 @@ public void stop(Context context) { } public Response - nestedCheckNameAvailabilityWithResponse(NameAvailabilityRequest parameters, Context context) { + checkChildrenNameAvailabilityWithResponse(NameAvailabilityRequest parameters, Context context) { return serviceManager.services() - .nestedCheckNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + .checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, 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 DataMigrationServiceImpl withRegion(Region location) { @@ -235,4 +252,19 @@ public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { this.innerModel().withVirtualSubnetId(virtualSubnetId); return this; } + + public DataMigrationServiceImpl withVirtualNicId(String virtualNicId) { + this.innerModel().withVirtualNicId(virtualNicId); + return this; + } + + public DataMigrationServiceImpl withAutoStopDelay(String autoStopDelay) { + this.innerModel().withAutoStopDelay(autoStopDelay); + return this; + } + + public DataMigrationServiceImpl withDeleteResourcesOnStop(Boolean deleteResourcesOnStop) { + this.innerModel().withDeleteResourcesOnStop(deleteResourcesOnStop); + return this; + } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java index 5ccbe4616bf4..3e1376a71b8d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java @@ -24,6 +24,10 @@ public String agentVersion() { return this.innerModel().agentVersion(); } + public Object agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + public String status() { return this.innerModel().status(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationBaseImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationBaseImpl.java new file mode 100644 index 000000000000..671f15ae057b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationBaseImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationBase; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationBaseProperties; + +public final class DatabaseMigrationBaseImpl implements DatabaseMigrationBase { + private DatabaseMigrationBaseInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DatabaseMigrationBaseImpl(DatabaseMigrationBaseInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationBaseProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationBaseInner 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/DatabaseMigrationCosmosDbMongoImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationCosmosDbMongoImpl.java new file mode 100644 index 000000000000..de74c27ffd7a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationCosmosDbMongoImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; + +public final class DatabaseMigrationCosmosDbMongoImpl + implements DatabaseMigrationCosmosDbMongo, DatabaseMigrationCosmosDbMongo.Definition { + private DatabaseMigrationCosmosDbMongoInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DatabaseMigrationCosmosDbMongoImpl(DatabaseMigrationCosmosDbMongoInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationPropertiesCosmosDbMongo properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationCosmosDbMongoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String targetResourceName; + + private String migrationName; + + public DatabaseMigrationCosmosDbMongoImpl withExistingDatabaseAccount(String resourceGroupName, + String targetResourceName) { + this.resourceGroupName = resourceGroupName; + this.targetResourceName = targetResourceName; + return this; + } + + public DatabaseMigrationCosmosDbMongo create() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsMongoToCosmosDbRUMongoes() + .create(resourceGroupName, targetResourceName, migrationName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationCosmosDbMongo create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsMongoToCosmosDbRUMongoes() + .create(resourceGroupName, targetResourceName, migrationName, this.innerModel(), context); + return this; + } + + DatabaseMigrationCosmosDbMongoImpl(String name, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationCosmosDbMongoInner(); + this.serviceManager = serviceManager; + this.migrationName = name; + } + + public DatabaseMigrationCosmosDbMongo refresh() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse(resourceGroupName, targetResourceName, migrationName, Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationCosmosDbMongo refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse(resourceGroupName, targetResourceName, migrationName, context) + .getValue(); + return this; + } + + public DatabaseMigrationCosmosDbMongoImpl withProperties(DatabaseMigrationPropertiesCosmosDbMongo properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.java new file mode 100644 index 000000000000..9995c675b804 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationProperties; + +public final class DatabaseMigrationImpl implements DatabaseMigration { + private DatabaseMigrationInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DatabaseMigrationImpl(DatabaseMigrationInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DatabaseMigrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.java new file mode 100644 index 000000000000..31a2117f10ea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlDbImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlDb; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.util.UUID; + +public final class DatabaseMigrationSqlDbImpl + implements DatabaseMigrationSqlDb, DatabaseMigrationSqlDb.Definition, DatabaseMigrationSqlDb.Update { + private DatabaseMigrationSqlDbInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationPropertiesSqlDb properties() { + return this.innerModel().properties(); + } + + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DatabaseMigrationSqlDbInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlDbInstanceName; + + private String targetDbName; + + public DatabaseMigrationSqlDbImpl withExistingServer(String resourceGroupName, String sqlDbInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sqlDbInstanceName = sqlDbInstanceName; + return this; + } + + public DatabaseMigrationSqlDb create() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlDb create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlDbImpl(String name, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlDbInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlDbImpl update() { + return this; + } + + public DatabaseMigrationSqlDb apply() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlDb apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .createOrUpdate(resourceGroupName, sqlDbInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlDbImpl(DatabaseMigrationSqlDbInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlDbInstanceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "servers"); + this.targetDbName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlDb refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, localMigrationOperationId, localExpand, + Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlDb refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlDbs() + .getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, localMigrationOperationId, localExpand, + context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager.databaseMigrationsSqlDbs() + .cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager.databaseMigrationsSqlDbs() + .cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlDbImpl withProperties(DatabaseMigrationPropertiesSqlDb properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java new file mode 100644 index 000000000000..91e111805761 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlMiImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlMi; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.util.UUID; + +public final class DatabaseMigrationSqlMiImpl + implements DatabaseMigrationSqlMi, DatabaseMigrationSqlMi.Definition, DatabaseMigrationSqlMi.Update { + private DatabaseMigrationSqlMiInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationPropertiesSqlMi properties() { + return this.innerModel().properties(); + } + + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DatabaseMigrationSqlMiInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String managedInstanceName; + + private String targetDbName; + + public DatabaseMigrationSqlMiImpl withExistingManagedInstance(String resourceGroupName, + String managedInstanceName) { + this.resourceGroupName = resourceGroupName; + this.managedInstanceName = managedInstanceName; + return this; + } + + public DatabaseMigrationSqlMi create() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlMi create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlMiImpl(String name, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlMiInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlMiImpl update() { + return this; + } + + public DatabaseMigrationSqlMi apply() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlMi apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .createOrUpdate(resourceGroupName, managedInstanceName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlMiImpl(DatabaseMigrationSqlMiInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.managedInstanceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedInstances"); + this.targetDbName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlMi refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .getWithResponse(resourceGroupName, managedInstanceName, targetDbName, localMigrationOperationId, + localExpand, Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlMi refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlMis() + .getWithResponse(resourceGroupName, managedInstanceName, targetDbName, localMigrationOperationId, + localExpand, context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager.databaseMigrationsSqlMis() + .cancel(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager.databaseMigrationsSqlMis() + .cancel(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public void cutover(MigrationOperationInput parameters) { + serviceManager.databaseMigrationsSqlMis() + .cutover(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cutover(MigrationOperationInput parameters, Context context) { + serviceManager.databaseMigrationsSqlMis() + .cutover(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlMiImpl withProperties(DatabaseMigrationPropertiesSqlMi properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java new file mode 100644 index 000000000000..2b352cb7a45a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationSqlVmImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlVm; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.util.UUID; + +public final class DatabaseMigrationSqlVmImpl + implements DatabaseMigrationSqlVm, DatabaseMigrationSqlVm.Definition, DatabaseMigrationSqlVm.Update { + private DatabaseMigrationSqlVmInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatabaseMigrationPropertiesSqlVm properties() { + return this.innerModel().properties(); + } + + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DatabaseMigrationSqlVmInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlVirtualMachineName; + + private String targetDbName; + + public DatabaseMigrationSqlVmImpl withExistingSqlVirtualMachine(String resourceGroupName, + String sqlVirtualMachineName) { + this.resourceGroupName = resourceGroupName; + this.sqlVirtualMachineName = sqlVirtualMachineName; + return this; + } + + public DatabaseMigrationSqlVm create() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlVm create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlVmImpl(String name, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DatabaseMigrationSqlVmInner(); + this.serviceManager = serviceManager; + this.targetDbName = name; + } + + public DatabaseMigrationSqlVmImpl update() { + return this; + } + + public DatabaseMigrationSqlVm apply() { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), Context.NONE); + return this; + } + + public DatabaseMigrationSqlVm apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .createOrUpdate(resourceGroupName, sqlVirtualMachineName, targetDbName, this.innerModel(), context); + return this; + } + + DatabaseMigrationSqlVmImpl(DatabaseMigrationSqlVmInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlVirtualMachineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sqlVirtualMachines"); + this.targetDbName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "databaseMigrations"); + } + + public DatabaseMigrationSqlVm refresh() { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, localMigrationOperationId, + localExpand, Context.NONE) + .getValue(); + return this; + } + + public DatabaseMigrationSqlVm refresh(Context context) { + UUID localMigrationOperationId = null; + String localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getDatabaseMigrationsSqlVms() + .getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, localMigrationOperationId, + localExpand, context) + .getValue(); + return this; + } + + public void cancel(MigrationOperationInput parameters) { + serviceManager.databaseMigrationsSqlVms() + .cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cancel(MigrationOperationInput parameters, Context context) { + serviceManager.databaseMigrationsSqlVms() + .cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public void cutover(MigrationOperationInput parameters) { + serviceManager.databaseMigrationsSqlVms() + .cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cutover(MigrationOperationInput parameters, Context context) { + serviceManager.databaseMigrationsSqlVms() + .cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlVmImpl withProperties(DatabaseMigrationPropertiesSqlVm properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl.java new file mode 100644 index 000000000000..489506e63fb0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl.java @@ -0,0 +1,1037 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsMongoToCosmosDbRUMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationCosmosDbMongoListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationsMongoToCosmosDbRUMongoesClient. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl + implements DatabaseMigrationsMongoToCosmosDbRUMongoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationsMongoToCosmosDbRUMongoesService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(DatabaseMigrationsMongoToCosmosDbRUMongoesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * DataMigrationManagementClientDatabaseMigrationsMongoToCosmosDbRUMongoes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface DatabaseMigrationsMongoToCosmosDbRUMongoesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationCosmosDbMongoInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @QueryParam("force") Boolean force, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getForScope(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String targetResourceName, + String migrationName) { + return getWithResponseAsync(resourceGroupName, targetResourceName, migrationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String targetResourceName, String migrationName, Context context) { + return getWithResponseAsync(resourceGroupName, targetResourceName, migrationName, context).block(); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner get(String resourceGroupName, String targetResourceName, + String migrationName) { + return getWithResponse(resourceGroupName, targetResourceName, migrationName, Context.NONE).getValue(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationCosmosDbMongoInner> + beginCreateAsync(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, targetResourceName, migrationName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationCosmosDbMongoInner.class, + DatabaseMigrationCosmosDbMongoInner.class, this.client.getContext()); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationCosmosDbMongoInner> + beginCreateAsync(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, targetResourceName, migrationName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationCosmosDbMongoInner.class, + DatabaseMigrationCosmosDbMongoInner.class, context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters) { + return this.beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + return beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + return createAsync(resourceGroupName, targetResourceName, migrationName, parameters).block(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return createAsync(resourceGroupName, targetResourceName, migrationName, parameters, context).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, force, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Boolean force, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, force, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force, context) + .getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String targetResourceName, String migrationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, targetResourceName, migrationName, force).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, targetResourceName, migrationName, force, context).block(); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getForScopeSinglePageAsync(String resourceGroupName, String targetResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getForScope(this.client.getEndpoint(), resourceGroupName, + targetResourceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getForScopeSinglePageAsync(String resourceGroupName, String targetResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getForScope(this.client.getEndpoint(), resourceGroupName, targetResourceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getForScopeAsync(String resourceGroupName, + String targetResourceName) { + return new PagedFlux<>(() -> getForScopeSinglePageAsync(resourceGroupName, targetResourceName), + nextLink -> getForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getForScopeAsync(String resourceGroupName, + String targetResourceName, Context context) { + return new PagedFlux<>(() -> getForScopeSinglePageAsync(resourceGroupName, targetResourceName, context), + nextLink -> getForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName) { + return new PagedIterable<>(getForScopeAsync(resourceGroupName, targetResourceName)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName, Context context) { + return new PagedIterable<>(getForScopeAsync(resourceGroupName, targetResourceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getForScopeNextSinglePageAsync(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.getForScopeNext(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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getForScopeNextSinglePageAsync(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.getForScopeNext(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/DatabaseMigrationsMongoToCosmosDbRUMongoesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesImpl.java new file mode 100644 index 000000000000..b363b9bdcecf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbRUMongoesImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.DatabaseMigrationsMongoToCosmosDbRUMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsMongoToCosmosDbRUMongoes; + +public final class DatabaseMigrationsMongoToCosmosDbRUMongoesImpl + implements DatabaseMigrationsMongoToCosmosDbRUMongoes { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsMongoToCosmosDbRUMongoesImpl.class); + + private final DatabaseMigrationsMongoToCosmosDbRUMongoesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsMongoToCosmosDbRUMongoesImpl(DatabaseMigrationsMongoToCosmosDbRUMongoesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, targetResourceName, migrationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationCosmosDbMongoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationCosmosDbMongo get(String resourceGroupName, String targetResourceName, + String migrationName) { + DatabaseMigrationCosmosDbMongoInner inner + = this.serviceClient().get(resourceGroupName, targetResourceName, migrationName); + if (inner != null) { + return new DatabaseMigrationCosmosDbMongoImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String targetResourceName, String migrationName) { + this.serviceClient().delete(resourceGroupName, targetResourceName, migrationName); + } + + public void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, targetResourceName, migrationName, force, context); + } + + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName) { + PagedIterable inner + = this.serviceClient().getForScope(resourceGroupName, targetResourceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationCosmosDbMongoImpl(inner1, this.manager())); + } + + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName, Context context) { + PagedIterable inner + = this.serviceClient().getForScope(resourceGroupName, targetResourceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationCosmosDbMongoImpl(inner1, this.manager())); + } + + public DatabaseMigrationCosmosDbMongo getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String targetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseAccounts"); + if (targetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseAccounts'.", id))); + } + String migrationName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (migrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this.getWithResponse(resourceGroupName, targetResourceName, migrationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String targetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseAccounts"); + if (targetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseAccounts'.", id))); + } + String migrationName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (migrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this.getWithResponse(resourceGroupName, targetResourceName, migrationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String targetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseAccounts"); + if (targetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseAccounts'.", id))); + } + String migrationName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (migrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, targetResourceName, migrationName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String targetResourceName = ResourceManagerUtils.getValueFromIdByName(id, "databaseAccounts"); + if (targetResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseAccounts'.", id))); + } + String migrationName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (migrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + this.delete(resourceGroupName, targetResourceName, migrationName, force, context); + } + + private DatabaseMigrationsMongoToCosmosDbRUMongoesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationCosmosDbMongoImpl define(String name) { + return new DatabaseMigrationCosmosDbMongoImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl.java new file mode 100644 index 000000000000..c02055c29b9c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl.java @@ -0,0 +1,1037 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationCosmosDbMongoListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl + implements DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationsMongoToCosmosDbvCoreMongoesService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(DatabaseMigrationsMongoToCosmosDbvCoreMongoesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * DataMigrationManagementClientDatabaseMigrationsMongoToCosmosDbvCoreMongoes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface DatabaseMigrationsMongoToCosmosDbvCoreMongoesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationCosmosDbMongoInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations/{migrationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("migrationName") String migrationName, @QueryParam("force") Boolean force, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{targetResourceName}/providers/Microsoft.DataMigration/databaseMigrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getForScope(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("targetResourceName") String targetResourceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String targetResourceName, + String migrationName) { + return getWithResponseAsync(resourceGroupName, targetResourceName, migrationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String targetResourceName, String migrationName, Context context) { + return getWithResponseAsync(resourceGroupName, targetResourceName, migrationName, context).block(); + } + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner get(String resourceGroupName, String targetResourceName, + String migrationName) { + return getWithResponse(resourceGroupName, targetResourceName, migrationName, Context.NONE).getValue(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationCosmosDbMongoInner> + beginCreateAsync(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, targetResourceName, migrationName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationCosmosDbMongoInner.class, + DatabaseMigrationCosmosDbMongoInner.class, this.client.getContext()); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationCosmosDbMongoInner> + beginCreateAsync(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, targetResourceName, migrationName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationCosmosDbMongoInner.class, + DatabaseMigrationCosmosDbMongoInner.class, context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters) { + return this.beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationCosmosDbMongoInner> beginCreate( + String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + return beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, targetResourceName, migrationName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + return createAsync(resourceGroupName, targetResourceName, migrationName, parameters).block(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationCosmosDbMongoInner create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + return createAsync(resourceGroupName, targetResourceName, migrationName, parameters, context).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, targetResourceName, + migrationName, force, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String targetResourceName, String migrationName, Boolean force, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, targetResourceName, migrationName, force, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, targetResourceName, migrationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String targetResourceName, + String migrationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force, context) + .getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String targetResourceName, String migrationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, targetResourceName, migrationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String targetResourceName, String migrationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, targetResourceName, migrationName, force).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, targetResourceName, migrationName, force, context).block(); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getForScopeSinglePageAsync(String resourceGroupName, String targetResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getForScope(this.client.getEndpoint(), resourceGroupName, + targetResourceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getForScopeSinglePageAsync(String resourceGroupName, String targetResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (targetResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter targetResourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getForScope(this.client.getEndpoint(), resourceGroupName, targetResourceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getForScopeAsync(String resourceGroupName, + String targetResourceName) { + return new PagedFlux<>(() -> getForScopeSinglePageAsync(resourceGroupName, targetResourceName), + nextLink -> getForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getForScopeAsync(String resourceGroupName, + String targetResourceName, Context context) { + return new PagedFlux<>(() -> getForScopeSinglePageAsync(resourceGroupName, targetResourceName, context), + nextLink -> getForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName) { + return new PagedIterable<>(getForScopeAsync(resourceGroupName, targetResourceName)); + } + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName, Context context) { + return new PagedIterable<>(getForScopeAsync(resourceGroupName, targetResourceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getForScopeNextSinglePageAsync(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.getForScopeNext(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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getForScopeNextSinglePageAsync(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.getForScopeNext(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/DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl.java new file mode 100644 index 000000000000..79768f6f8c2f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl.java @@ -0,0 +1,110 @@ +// Copyright (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.DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsMongoToCosmosDbvCoreMongoes; + +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl + implements DatabaseMigrationsMongoToCosmosDbvCoreMongoes { + private static final ClientLogger LOGGER + = new ClientLogger(DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl.class); + + private final DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsMongoToCosmosDbvCoreMongoesImpl( + DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, targetResourceName, migrationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationCosmosDbMongoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationCosmosDbMongo get(String resourceGroupName, String targetResourceName, + String migrationName) { + DatabaseMigrationCosmosDbMongoInner inner + = this.serviceClient().get(resourceGroupName, targetResourceName, migrationName); + if (inner != null) { + return new DatabaseMigrationCosmosDbMongoImpl(inner, this.manager()); + } else { + return null; + } + } + + public DatabaseMigrationCosmosDbMongo create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters) { + DatabaseMigrationCosmosDbMongoInner inner + = this.serviceClient().create(resourceGroupName, targetResourceName, migrationName, parameters); + if (inner != null) { + return new DatabaseMigrationCosmosDbMongoImpl(inner, this.manager()); + } else { + return null; + } + } + + public DatabaseMigrationCosmosDbMongo create(String resourceGroupName, String targetResourceName, + String migrationName, DatabaseMigrationCosmosDbMongoInner parameters, Context context) { + DatabaseMigrationCosmosDbMongoInner inner + = this.serviceClient().create(resourceGroupName, targetResourceName, migrationName, parameters, context); + if (inner != null) { + return new DatabaseMigrationCosmosDbMongoImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String targetResourceName, String migrationName) { + this.serviceClient().delete(resourceGroupName, targetResourceName, migrationName); + } + + public void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, targetResourceName, migrationName, force, context); + } + + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName) { + PagedIterable inner + = this.serviceClient().getForScope(resourceGroupName, targetResourceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationCosmosDbMongoImpl(inner1, this.manager())); + } + + public PagedIterable getForScope(String resourceGroupName, + String targetResourceName, Context context) { + PagedIterable inner + = this.serviceClient().getForScope(resourceGroupName, targetResourceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DatabaseMigrationCosmosDbMongoImpl(inner1, this.manager())); + } + + private DatabaseMigrationsMongoToCosmosDbvCoreMongoesClient 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/DatabaseMigrationsSqlDbsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java new file mode 100644 index 000000000000..f421c47e88fd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsClientImpl.java @@ -0,0 +1,1092 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlDbsClient. + */ +public final class DatabaseMigrationsSqlDbsClientImpl implements DatabaseMigrationsSqlDbsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationsSqlDbsService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlDbsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlDbsClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(DatabaseMigrationsSqlDbsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlDbs to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface DatabaseMigrationsSqlDbsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlDbInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, @PathParam("targetDbName") String targetDbName, + @QueryParam("force") Boolean force, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{sqlDbInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlDbInstanceName") String sqlDbInstanceName, @PathParam("targetDbName") String targetDbName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, Context context); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String sqlDbInstanceName, String targetDbName, UUID migrationOperationId, String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, + targetDbName, migrationOperationId, expand, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String sqlDbInstanceName, String targetDbName, UUID migrationOperationId, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, targetDbName, + migrationOperationId, expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, + context).block(); + } + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner get(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, + Context.NONE).getValue(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlDbInstanceName, String targetDbName, DatabaseMigrationSqlDbInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + sqlDbInstanceName, targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlDbInstanceName, String targetDbName, DatabaseMigrationSqlDbInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlDbInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlDbInner.class, DatabaseMigrationSqlDbInner.class, + this.client.getContext()); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlDbInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, DatabaseMigrationSqlDbInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlDbInner.class, DatabaseMigrationSqlDbInner.class, + context); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, + DatabaseMigrationSqlDbInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlDbInner> beginCreateOrUpdate( + String resourceGroupName, String sqlDbInstanceName, String targetDbName, DatabaseMigrationSqlDbInner parameters, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, DatabaseMigrationSqlDbInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, DatabaseMigrationSqlDbInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner createOrUpdate(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, DatabaseMigrationSqlDbInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).block(); + } + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of Sql Db migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlDbInner createOrUpdate(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, DatabaseMigrationSqlDbInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, + targetDbName, force, this.client.getSubscriptionId(), this.client.getApiVersion(), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, targetDbName, force, + this.client.getSubscriptionId(), this.client.getApiVersion(), context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlDbInstanceName, + String targetDbName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context) + .getSyncPoller(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + final Boolean force = null; + deleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force).block(); + } + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, sqlDbInstanceName, targetDbName, force, context).block(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, + targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlDbInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlDbInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), resourceGroupName, sqlDbInstanceName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters) { + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters) { + return this.beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + return this.beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + return beginCancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters).block(); + } + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + cancelAsync(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java new file mode 100644 index 000000000000..dced2e6b8e3c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlDbsImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlDbsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlDb; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlDbs; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlDbsImpl implements DatabaseMigrationsSqlDbs { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlDbsImpl.class); + + private final DatabaseMigrationsSqlDbsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlDbsImpl(DatabaseMigrationsSqlDbsClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationSqlDbImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationSqlDb get(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + DatabaseMigrationSqlDbInner inner + = this.serviceClient().get(resourceGroupName, sqlDbInstanceName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlDbImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName) { + this.serviceClient().delete(resourceGroupName, sqlDbInstanceName, targetDbName); + } + + public void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + } + + public void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters); + } + + public void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + this.serviceClient().cancel(resourceGroupName, sqlDbInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlDb getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, localMigrationOperationId, localExpand, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this.getWithResponse(resourceGroupName, sqlDbInstanceName, targetDbName, migrationOperationId, expand, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, sqlDbInstanceName, targetDbName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlDbInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "servers"); + if (sqlDbInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'servers'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + this.delete(resourceGroupName, sqlDbInstanceName, targetDbName, force, context); + } + + private DatabaseMigrationsSqlDbsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlDbImpl define(String name) { + return new DatabaseMigrationSqlDbImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java new file mode 100644 index 000000000000..1b4df1668aa3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisClientImpl.java @@ -0,0 +1,1058 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlMisClient. + */ +public final class DatabaseMigrationsSqlMisClientImpl implements DatabaseMigrationsSqlMisClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationsSqlMisService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlMisClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlMisClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(DatabaseMigrationsSqlMisService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlMis to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface DatabaseMigrationsSqlMisService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlMiInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutover(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedInstanceName") String managedInstanceName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, Context context); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, UUID migrationOperationId, String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, managedInstanceName, + targetDbName, migrationOperationId, expand, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, UUID migrationOperationId, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, managedInstanceName, targetDbName, + migrationOperationId, expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String managedInstanceName, + String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String managedInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, + context).block(); + } + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner get(String resourceGroupName, String managedInstanceName, String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponse(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, + Context.NONE).getValue(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, DatabaseMigrationSqlMiInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + managedInstanceName, targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, DatabaseMigrationSqlMiInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, managedInstanceName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlMiInner> beginCreateOrUpdateAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlMiInner.class, DatabaseMigrationSqlMiInner.class, + this.client.getContext()); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlMiInner> beginCreateOrUpdateAsync( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, managedInstanceName, + targetDbName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlMiInner.class, DatabaseMigrationSqlMiInner.class, + context); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlMiInner> beginCreateOrUpdate( + String resourceGroupName, String managedInstanceName, String targetDbName, + DatabaseMigrationSqlMiInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner createOrUpdate(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters) { + return createOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Create a new database migration to a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlMiInner createOrUpdate(String resourceGroupName, String managedInstanceName, + String targetDbName, DatabaseMigrationSqlMiInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), resourceGroupName, managedInstanceName, + targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, MigrationOperationInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), resourceGroupName, managedInstanceName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters) { + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters) { + return this.beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + return this.beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + return beginCancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + cancelAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext(context -> service.cutover(this.client.getEndpoint(), resourceGroupName, managedInstanceName, + targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync(String resourceGroupName, + String managedInstanceName, String targetDbName, MigrationOperationInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service.cutover(this.client.getEndpoint(), resourceGroupName, managedInstanceName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters) { + Mono>> mono + = cutoverWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cutoverWithResponseAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters) { + return this.beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover(String resourceGroupName, String managedInstanceName, + String targetDbName, MigrationOperationInput parameters, Context context) { + return this.beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + return beginCutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + cutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + cutoverAsync(resourceGroupName, managedInstanceName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.java new file mode 100644 index 000000000000..f05f7c7e8a41 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlMisImpl.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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlMisClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlMi; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlMis; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlMisImpl implements DatabaseMigrationsSqlMis { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlMisImpl.class); + + private final DatabaseMigrationsSqlMisClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlMisImpl(DatabaseMigrationsSqlMisClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String managedInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationSqlMiImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationSqlMi get(String resourceGroupName, String managedInstanceName, String targetDbName) { + DatabaseMigrationSqlMiInner inner + = this.serviceClient().get(resourceGroupName, managedInstanceName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlMiImpl(inner, this.manager()); + } else { + return null; + } + } + + public void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + this.serviceClient().cancel(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cutover(resourceGroupName, managedInstanceName, targetDbName, parameters); + } + + public void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context) { + this.serviceClient().cutover(resourceGroupName, managedInstanceName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlMi getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String managedInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "managedInstances"); + if (managedInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse(resourceGroupName, managedInstanceName, targetDbName, localMigrationOperationId, + localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String managedInstanceName = ResourceManagerUtils.getValueFromIdByName(id, "managedInstances"); + if (managedInstanceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this.getWithResponse(resourceGroupName, managedInstanceName, targetDbName, migrationOperationId, expand, + context); + } + + private DatabaseMigrationsSqlMisClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlMiImpl define(String name) { + return new DatabaseMigrationSqlMiImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java new file mode 100644 index 000000000000..def61eca0a72 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsClientImpl.java @@ -0,0 +1,1062 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.nio.ByteBuffer; +import java.util.UUID; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DatabaseMigrationsSqlVmsClient. + */ +public final class DatabaseMigrationsSqlVmsClientImpl implements DatabaseMigrationsSqlVmsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DatabaseMigrationsSqlVmsService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of DatabaseMigrationsSqlVmsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatabaseMigrationsSqlVmsClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(DatabaseMigrationsSqlVmsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientDatabaseMigrationsSqlVms to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface DatabaseMigrationsSqlVmsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, + @QueryParam("migrationOperationId") UUID migrationOperationId, @QueryParam("$expand") String expand, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatabaseMigrationSqlVmInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cancel") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cancel(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}/providers/Microsoft.DataMigration/databaseMigrations/{targetDbName}/cutover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> cutover(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlVirtualMachineName") String sqlVirtualMachineName, + @PathParam("targetDbName") String targetDbName, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationOperationInput parameters, Context context); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, UUID migrationOperationId, String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, + targetDbName, migrationOperationId, expand, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, UUID migrationOperationId, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, targetDbName, + migrationOperationId, expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, + expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + return getWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, + expand, context).block(); + } + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner get(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName) { + final UUID migrationOperationId = null; + final String expand = null; + return getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand, + Context.NONE).getValue(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, DatabaseMigrationSqlVmInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + sqlVirtualMachineName, targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, DatabaseMigrationSqlVmInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlVmInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlVmInner.class, DatabaseMigrationSqlVmInner.class, + this.client.getContext()); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DatabaseMigrationSqlVmInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + sqlVirtualMachineName, targetDbName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DatabaseMigrationSqlVmInner.class, DatabaseMigrationSqlVmInner.class, + context); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DatabaseMigrationSqlVmInner> beginCreateOrUpdate( + String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + DatabaseMigrationSqlVmInner parameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, DatabaseMigrationSqlVmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, DatabaseMigrationSqlVmInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner createOrUpdate(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, DatabaseMigrationSqlVmInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Create a new database migration to a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatabaseMigrationSqlVmInner createOrUpdate(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, DatabaseMigrationSqlVmInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, + targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cancelWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, MigrationOperationInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters) { + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cancelWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters) { + return this.beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCancel(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context) { + return this.beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + return beginCancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + cancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + cancelAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, MigrationOperationInput parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext(context -> service.cutover(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, + targetDbName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> cutoverWithResponseAsync(String resourceGroupName, + String sqlVirtualMachineName, String targetDbName, MigrationOperationInput parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlVirtualMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter sqlVirtualMachineName is required and cannot be null.")); + } + if (targetDbName == null) { + return Mono.error(new IllegalArgumentException("Parameter targetDbName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service.cutover(this.client.getEndpoint(), resourceGroupName, sqlVirtualMachineName, targetDbName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters) { + Mono>> mono + = cutoverWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCutoverAsync(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = cutoverWithResponseAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters) { + return this.beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters) + .getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCutover(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, MigrationOperationInput parameters, Context context) { + return this.beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context) + .getSyncPoller(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cutoverAsync(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + return beginCutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + cutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters).block(); + } + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + cutoverAsync(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context).block(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.java new file mode 100644 index 000000000000..6de495fd7ea3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DatabaseMigrationsSqlVmsImpl.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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.DatabaseMigrationsSqlVmsClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationSqlVm; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationsSqlVms; +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +public final class DatabaseMigrationsSqlVmsImpl implements DatabaseMigrationsSqlVms { + private static final ClientLogger LOGGER = new ClientLogger(DatabaseMigrationsSqlVmsImpl.class); + + private final DatabaseMigrationsSqlVmsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public DatabaseMigrationsSqlVmsImpl(DatabaseMigrationsSqlVmsClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, UUID migrationOperationId, String expand, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, expand, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DatabaseMigrationSqlVmImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DatabaseMigrationSqlVm get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName) { + DatabaseMigrationSqlVmInner inner + = this.serviceClient().get(resourceGroupName, sqlVirtualMachineName, targetDbName); + if (inner != null) { + return new DatabaseMigrationSqlVmImpl(inner, this.manager()); + } else { + return null; + } + } + + public void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + this.serviceClient().cancel(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters) { + this.serviceClient().cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters); + } + + public void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context) { + this.serviceClient().cutover(resourceGroupName, sqlVirtualMachineName, targetDbName, parameters, context); + } + + public DatabaseMigrationSqlVm getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlVirtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "sqlVirtualMachines"); + if (sqlVirtualMachineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlVirtualMachines'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + UUID localMigrationOperationId = null; + String localExpand = null; + return this + .getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, localMigrationOperationId, + localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlVirtualMachineName = ResourceManagerUtils.getValueFromIdByName(id, "sqlVirtualMachines"); + if (sqlVirtualMachineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlVirtualMachines'.", id))); + } + String targetDbName = ResourceManagerUtils.getValueFromIdByName(id, "databaseMigrations"); + if (targetDbName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'databaseMigrations'.", id))); + } + return this.getWithResponse(resourceGroupName, sqlVirtualMachineName, targetDbName, migrationOperationId, + expand, context); + } + + private DatabaseMigrationsSqlVmsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DatabaseMigrationSqlVmImpl define(String name) { + return new DatabaseMigrationSqlVmImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java new file mode 100644 index 000000000000..b683233db3e0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DeleteNodeImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.models.DeleteNode; + +public final class DeleteNodeImpl implements DeleteNode { + private DeleteNodeInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DeleteNodeImpl(DeleteNodeInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nodeName() { + return this.innerModel().nodeName(); + } + + public String integrationRuntimeName() { + return this.innerModel().integrationRuntimeName(); + } + + public DeleteNodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java new file mode 100644 index 000000000000..611ee7815fbd --- /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 000000000000..30ad294aec16 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java @@ -0,0 +1,1299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FilesClient. + */ +public final class FilesClientImpl implements FilesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FilesService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of FilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FilesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(FilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientFiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public 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); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String groupName, String serviceName, + String projectName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String groupName, String serviceName, + String projectName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, projectName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String projectName) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String projectName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, projectName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String projectName) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName)); + } + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String projectName, + Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName, context)); + } + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, fileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, fileName, this.client.getApiVersion(), accept, context); + } + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String projectName, String fileName) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * Get file information + * + * 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 getWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + /** + * Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, fileName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, ProjectFileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, fileName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String groupName, String serviceName, String projectName, + String fileName, ProjectFileInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a file resource + * + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String groupName, String serviceName, + String projectName, String fileName, ProjectFileInner parameters, Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context) + .block(); + } + + /** + * Create a file resource + * + * 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 createOrUpdateWithResponse(groupName, serviceName, projectName, fileName, parameters, Context.NONE) + .getValue(); + } + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String groupName, String serviceName, String projectName, + String fileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, projectName, fileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String groupName, String serviceName, String projectName, + String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, fileName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String projectName, String fileName) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String groupName, String serviceName, String projectName, String fileName, + Context context) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * Delete file + * + * 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) { + deleteWithResponse(groupName, serviceName, projectName, fileName, Context.NONE); + } + + /** + * Update a file + * + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, fileName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a file + * + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, ProjectFileInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, fileName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Update a file + * + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String groupName, String serviceName, String projectName, + String fileName, ProjectFileInner parameters) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a file + * + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String groupName, String serviceName, String projectName, + String fileName, ProjectFileInner parameters, Context context) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context).block(); + } + + /** + * Update a file + * + * 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 updateWithResponse(groupName, serviceName, projectName, fileName, parameters, Context.NONE).getValue(); + } + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.read(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, fileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.read(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, fileName, this.client.getApiVersion(), accept, context); + } + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readAsync(String groupName, String serviceName, String projectName, + String fileName) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * Request storage information for downloading the file content + * + * 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 readWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.readWrite(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, projectName, fileName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync(String groupName, String serviceName, + String projectName, String fileName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.readWrite(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, fileName, this.client.getApiVersion(), accept, context); + } + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readWriteAsync(String groupName, String serviceName, String projectName, + String fileName) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWriteWithResponse(String groupName, String serviceName, + String projectName, String fileName, Context context) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * Request information for reading and writing file content. + * + * 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 readWriteWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java new file mode 100644 index 000000000000..cf9739089d1c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import com.azure.resourcemanager.datamigration.models.Files; +import com.azure.resourcemanager.datamigration.models.ProjectFile; + +public final class FilesImpl implements Files { + private static final ClientLogger LOGGER = new ClientLogger(FilesImpl.class); + + private final FilesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public FilesImpl(FilesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName, String projectName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectFileImpl(inner1, this.manager())); + } + + 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 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 deleteWithResponse(String groupName, String serviceName, String projectName, String fileName, + Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public void delete(String groupName, String serviceName, String projectName, String fileName) { + this.serviceClient().delete(groupName, serviceName, projectName, fileName); + } + + 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 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 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 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 ProjectFile getById(String id) { + String groupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + this.deleteWithResponse(groupName, serviceName, projectName, fileName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String groupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + private FilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public ProjectFileImpl define(String name) { + return new ProjectFileImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.java new file mode 100644 index 000000000000..2552383617d0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/IntegrationRuntimeMonitoringDataImpl.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.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.NodeMonitoringData; +import java.util.Collections; +import java.util.List; + +public final class IntegrationRuntimeMonitoringDataImpl implements IntegrationRuntimeMonitoringData { + private IntegrationRuntimeMonitoringDataInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + IntegrationRuntimeMonitoringDataImpl(IntegrationRuntimeMonitoringDataInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public List nodes() { + List inner = this.innerModel().nodes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IntegrationRuntimeMonitoringDataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServiceImpl.java new file mode 100644 index 000000000000..9eee0954b976 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServiceImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.MigrationService; +import com.azure.resourcemanager.datamigration.models.MigrationServiceUpdate; +import com.azure.resourcemanager.datamigration.models.ProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class MigrationServiceImpl + implements MigrationService, MigrationService.Definition, MigrationService.Update { + private MigrationServiceInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String integrationRuntimeState() { + return this.innerModel().integrationRuntimeState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MigrationServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String migrationServiceName; + + private MigrationServiceUpdate updateParameters; + + public MigrationServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public MigrationService create() { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .createOrUpdate(resourceGroupName, migrationServiceName, this.innerModel(), Context.NONE); + return this; + } + + public MigrationService create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .createOrUpdate(resourceGroupName, migrationServiceName, this.innerModel(), context); + return this; + } + + MigrationServiceImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new MigrationServiceInner(); + this.serviceManager = serviceManager; + this.migrationServiceName = name; + } + + public MigrationServiceImpl update() { + this.updateParameters = new MigrationServiceUpdate(); + return this; + } + + public MigrationService apply() { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .update(resourceGroupName, migrationServiceName, updateParameters, Context.NONE); + return this; + } + + public MigrationService apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .update(resourceGroupName, migrationServiceName, updateParameters, context); + return this; + } + + MigrationServiceImpl(MigrationServiceInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.migrationServiceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "migrationServices"); + } + + public MigrationService refresh() { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, Context.NONE) + .getValue(); + return this; + } + + public MigrationService refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, context) + .getValue(); + return this; + } + + public MigrationServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MigrationServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MigrationServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesClientImpl.java new file mode 100644 index 000000000000..8ad1204fede3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesClientImpl.java @@ -0,0 +1,1551 @@ +// Copyright (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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.MigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationBaseListResult; +import com.azure.resourcemanager.datamigration.models.MigrationServiceListResult; +import com.azure.resourcemanager.datamigration.models.MigrationServiceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MigrationServicesClient. + */ +public final class MigrationServicesClientImpl implements MigrationServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MigrationServicesService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of MigrationServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MigrationServicesClientImpl(DataMigrationManagementClientImpl client) { + this.service + = RestProxy.create(MigrationServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientMigrationServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface MigrationServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("migrationServiceName") String migrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("migrationServiceName") String migrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationServiceInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("migrationServiceName") String migrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("migrationServiceName") String migrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MigrationServiceUpdate parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/migrationServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/migrationServices/{migrationServiceName}/listMigrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrations(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("migrationServiceName") String migrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String migrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + migrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String migrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String migrationServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, migrationServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String migrationServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, migrationServiceName, context).block(); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationServiceInner getByResourceGroup(String resourceGroupName, String migrationServiceName) { + return getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, Context.NONE).getValue(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String migrationServiceName, MigrationServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String migrationServiceName, MigrationServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String migrationServiceName, MigrationServiceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, migrationServiceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MigrationServiceInner.class, MigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String migrationServiceName, MigrationServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, migrationServiceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MigrationServiceInner.class, MigrationServiceInner.class, context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationServiceInner> + beginCreateOrUpdate(String resourceGroupName, String migrationServiceName, MigrationServiceInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, migrationServiceName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String migrationServiceName, MigrationServiceInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, migrationServiceName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, migrationServiceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, migrationServiceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationServiceInner createOrUpdate(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, migrationServiceName, parameters).block(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationServiceInner createOrUpdate(String resourceGroupName, String migrationServiceName, + MigrationServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, migrationServiceName, parameters, context).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String migrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String migrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String migrationServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, migrationServiceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String migrationServiceName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, migrationServiceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String migrationServiceName) { + return this.beginDeleteAsync(resourceGroupName, migrationServiceName).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String migrationServiceName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, migrationServiceName, context).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String migrationServiceName) { + return beginDeleteAsync(resourceGroupName, migrationServiceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String migrationServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, migrationServiceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String migrationServiceName) { + deleteAsync(resourceGroupName, migrationServiceName).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String migrationServiceName, Context context) { + deleteAsync(resourceGroupName, migrationServiceName, context).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationServiceInner> + beginUpdateAsync(String resourceGroupName, String migrationServiceName, MigrationServiceUpdate parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, migrationServiceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MigrationServiceInner.class, MigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MigrationServiceInner> beginUpdateAsync( + String resourceGroupName, String migrationServiceName, MigrationServiceUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, migrationServiceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MigrationServiceInner.class, MigrationServiceInner.class, context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationServiceInner> beginUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, migrationServiceName, parameters).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MigrationServiceInner> beginUpdate(String resourceGroupName, + String migrationServiceName, MigrationServiceUpdate parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, migrationServiceName, parameters, context).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, migrationServiceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, migrationServiceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationServiceInner update(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters) { + return updateAsync(resourceGroupName, migrationServiceName, parameters).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param parameters Details of MigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigrationServiceInner update(String resourceGroupName, String migrationServiceName, + MigrationServiceUpdate parameters, Context context) { + return updateAsync(resourceGroupName, migrationServiceName, parameters, context).block(); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieve all migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync(String resourceGroupName, + String migrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMigrations(this.client.getEndpoint(), resourceGroupName, + migrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync(String resourceGroupName, + String migrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (migrationServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter migrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMigrations(this.client.getEndpoint(), resourceGroupName, migrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync(String resourceGroupName, + String migrationServiceName) { + return new PagedFlux<>(() -> listMigrationsSinglePageAsync(resourceGroupName, migrationServiceName), + nextLink -> listMigrationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync(String resourceGroupName, + String migrationServiceName, Context context) { + return new PagedFlux<>(() -> listMigrationsSinglePageAsync(resourceGroupName, migrationServiceName, context), + nextLink -> listMigrationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations(String resourceGroupName, + String migrationServiceName) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, migrationServiceName)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations(String resourceGroupName, + String migrationServiceName, Context context) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, migrationServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesImpl.java new file mode 100644 index 000000000000..4559406cc17f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/MigrationServicesImpl.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.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.MigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationBase; +import com.azure.resourcemanager.datamigration.models.MigrationService; +import com.azure.resourcemanager.datamigration.models.MigrationServices; + +public final class MigrationServicesImpl implements MigrationServices { + private static final ClientLogger LOGGER = new ClientLogger(MigrationServicesImpl.class); + + private final MigrationServicesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public MigrationServicesImpl(MigrationServicesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String migrationServiceName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MigrationServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigrationService getByResourceGroup(String resourceGroupName, String migrationServiceName) { + MigrationServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, migrationServiceName); + if (inner != null) { + return new MigrationServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String migrationServiceName) { + this.serviceClient().delete(resourceGroupName, migrationServiceName); + } + + public void delete(String resourceGroupName, String migrationServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, migrationServiceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable listMigrations(String resourceGroupName, String migrationServiceName) { + PagedIterable inner + = this.serviceClient().listMigrations(resourceGroupName, migrationServiceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseMigrationBaseImpl(inner1, this.manager())); + } + + public PagedIterable listMigrations(String resourceGroupName, String migrationServiceName, + Context context) { + PagedIterable inner + = this.serviceClient().listMigrations(resourceGroupName, migrationServiceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseMigrationBaseImpl(inner1, this.manager())); + } + + public MigrationService getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String migrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "migrationServices"); + if (migrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrationServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String migrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "migrationServices"); + if (migrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrationServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, migrationServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String migrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "migrationServices"); + if (migrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrationServices'.", id))); + } + this.delete(resourceGroupName, migrationServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String migrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "migrationServices"); + if (migrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'migrationServices'.", id))); + } + this.delete(resourceGroupName, migrationServiceName, context); + } + + private MigrationServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public MigrationServiceImpl define(String name) { + return new MigrationServiceImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java index b5c4895a5732..52518f967724 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java @@ -26,8 +26,8 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperationList; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.datamigration.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -66,29 +66,27 @@ public interface OperationsService { @Get("/providers/Microsoft.DataMigration/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @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, + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects along with {@link PagedResponse} on successful completion of + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -97,25 +95,23 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .>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 available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects along with {@link PagedResponse} on successful completion of + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -128,63 +124,55 @@ private Mono> listSinglePageAsync(Context c } /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedFlux}. + * @return result of the request to list SQL operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedFlux}. + * @return result of the request to list SQL operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } @@ -195,11 +183,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects along with {@link PagedResponse} on successful completion of + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -209,7 +197,7 @@ private Mono> listNextSinglePageAsync(Strin } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + .>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())); } @@ -222,11 +210,11 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects along with {@link PagedResponse} on successful completion of + * @return result of the request to list SQL operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java new file mode 100644 index 000000000000..ae15761f667c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsDefinitionImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import com.azure.resourcemanager.datamigration.models.OperationOrigin; +import com.azure.resourcemanager.datamigration.models.OperationsDefinition; +import com.azure.resourcemanager.datamigration.models.OperationsDisplayDefinition; +import java.util.Collections; +import java.util.Map; + +public final class OperationsDefinitionImpl implements OperationsDefinition { + private OperationsDefinitionInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + OperationsDefinitionImpl(OperationsDefinitionInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationsDisplayDefinition display() { + return this.innerModel().display(); + } + + public OperationOrigin origin() { + return this.innerModel().origin(); + } + + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OperationsDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java index a6d44c4d3541..2d2842f07d93 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java @@ -8,9 +8,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.datamigration.fluent.OperationsClient; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; import com.azure.resourcemanager.datamigration.models.Operations; -import com.azure.resourcemanager.datamigration.models.ServiceOperation; +import com.azure.resourcemanager.datamigration.models.OperationsDefinition; public final class OperationsImpl implements Operations { private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); @@ -25,14 +25,14 @@ public OperationsImpl(OperationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationsDefinitionImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java new file mode 100644 index 000000000000..ee84610b4fb1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; + +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 SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return groupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "services"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + this.fileName = ResourceManagerUtils.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 Response readWithResponse(Context context) { + return serviceManager.files().readWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo read() { + return serviceManager.files().read(groupName, serviceName, projectName, fileName); + } + + public Response readWriteWithResponse(Context context) { + return serviceManager.files().readWriteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo readWrite() { + return serviceManager.files().readWrite(groupName, serviceName, projectName, fileName); + } + + public ProjectFileImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ProjectFileImpl withProperties(ProjectFileProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java index f175e1d65f0a..8ee9a70ce8bc 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java @@ -7,12 +7,14 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.azure.resourcemanager.datamigration.models.AzureActiveDirectoryApp; import com.azure.resourcemanager.datamigration.models.ConnectionInfo; import com.azure.resourcemanager.datamigration.models.DatabaseInfo; import com.azure.resourcemanager.datamigration.models.Project; import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -48,10 +50,22 @@ public Map tags() { } } + public String etag() { + return this.innerModel().etag(); + } + + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + public ProjectSourcePlatform sourcePlatform() { return this.innerModel().sourcePlatform(); } + public AzureActiveDirectoryApp azureAuthenticationInfo() { + return this.innerModel().azureAuthenticationInfo(); + } + public ProjectTargetPlatform targetPlatform() { return this.innerModel().targetPlatform(); } @@ -194,11 +208,21 @@ public ProjectImpl withTags(Map tags) { return this; } + public ProjectImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { this.innerModel().withSourcePlatform(sourcePlatform); return this; } + public ProjectImpl withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo) { + this.innerModel().withAzureAuthenticationInfo(azureAuthenticationInfo); + return this; + } + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { this.innerModel().withTargetPlatform(targetPlatform); return this; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java index 3916dbecd521..3a8c1dac80e0 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,9 +6,12 @@ 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; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; public final class ProjectTaskImpl implements ProjectTask, ProjectTask.Definition, ProjectTask.Update { private ProjectTaskInner innerObject; @@ -35,6 +38,10 @@ public ProjectTaskProperties properties() { return this.innerModel().properties(); } + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + public String resourceGroupName() { return groupName; } @@ -140,6 +147,15 @@ public ProjectTask cancel() { return serviceManager.tasks().cancel(groupName, serviceName, projectName, taskName); } + public Response commandWithResponse(CommandPropertiesInner parameters, Context context) { + return serviceManager.tasks() + .commandWithResponse(groupName, serviceName, projectName, taskName, parameters, context); + } + + public CommandProperties command(CommandPropertiesInner parameters) { + return serviceManager.tasks().command(groupName, serviceName, projectName, taskName, parameters); + } + 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 5120d5a8c73e..fa8917dcab3b 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 @@ -69,7 +69,7 @@ public interface ProjectsService { @Get("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/projects") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupName") String groupName, @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -117,9 +117,8 @@ Mono> update(@HostParam("$host") String endpoint, @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -137,7 +136,7 @@ Mono> listByResourceGroupNext( * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String groupName, String serviceName) { + private Mono> listSinglePageAsync(String groupName, String serviceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -154,8 +153,8 @@ private Mono> listByResourceGroupSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), groupName, serviceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, 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())); @@ -177,7 +176,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String groupName, String serviceName, + private Mono> listSinglePageAsync(String groupName, String serviceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -196,7 +195,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -216,9 +215,9 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @return oData page of project resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String groupName, String serviceName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(groupName, serviceName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String groupName, String serviceName) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -236,9 +235,9 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @return oData page of project resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String groupName, String serviceName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(groupName, serviceName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String groupName, String serviceName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -255,8 +254,8 @@ private PagedFlux listByResourceGroupAsync(String groupName, Strin * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String groupName, String serviceName) { - return new PagedIterable<>(listByResourceGroupAsync(groupName, serviceName)); + public PagedIterable list(String groupName, String serviceName) { + return new PagedIterable<>(listAsync(groupName, serviceName)); } /** @@ -274,8 +273,8 @@ public PagedIterable listByResourceGroup(String groupName, String * @return oData page of project resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String groupName, String serviceName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(groupName, serviceName, context)); + public PagedIterable list(String groupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, context)); } /** @@ -894,7 +893,7 @@ public ProjectInner update(String groupName, String serviceName, String projectN * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -903,9 +902,7 @@ private Mono> listByResourceGroupNextSinglePageAsync new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + 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())); @@ -923,7 +920,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -933,7 +930,7 @@ private Mono> listByResourceGroupNextSinglePageAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, 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/ProjectsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java index cf731e1cb470..d912967164aa 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 @@ -27,13 +27,13 @@ public ProjectsImpl(ProjectsClient innerClient, 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java new file mode 100644 index 000000000000..7708350e7ae5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/RegenAuthKeysImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; + +public final class RegenAuthKeysImpl implements RegenAuthKeys { + private RegenAuthKeysInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + RegenAuthKeysImpl(RegenAuthKeysInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String keyName() { + return this.innerModel().keyName(); + } + + public String authKey1() { + return this.innerModel().authKey1(); + } + + public String authKey2() { + return this.innerModel().authKey2(); + } + + public RegenAuthKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java index e960869e47c0..77582b4c9fe1 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java @@ -81,12 +81,12 @@ Mono> listSkusNext(@PathParam(value = "nextLink", e /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the DMS (classic) List SKUs operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -110,14 +110,14 @@ private Mono> listSinglePageAsync() { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the DMS (classic) List SKUs operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -141,11 +141,11 @@ private Mono> listSinglePageAsync(Context contex /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedFlux}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -155,13 +155,13 @@ private PagedFlux listAsync() { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedFlux}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -172,11 +172,11 @@ private PagedFlux listAsync(Context context) { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +186,13 @@ public PagedIterable list() { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -206,8 +206,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the DMS (classic) List SKUs operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink) { @@ -234,8 +234,8 @@ private Mono> listSkusNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the DMS (classic) List SKUs operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java new file mode 100644 index 000000000000..8e27ec56c9e1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java @@ -0,0 +1,1138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.TaskList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServiceTasksClient. + */ +public final class ServiceTasksClientImpl implements ServiceTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final ServiceTasksService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ServiceTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTasksClientImpl(DataMigrationManagementClientImpl client) { + this.service + = RestProxy.create(ServiceTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientServiceTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public 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); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String groupName, String serviceName, + String taskType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, this.client.getApiVersion(), taskType, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String groupName, String serviceName, + String taskType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + this.client.getApiVersion(), taskType, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String taskType) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, taskType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName) { + final String taskType = null; + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, taskType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String taskType, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(groupName, serviceName, taskType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName) { + final String taskType = null; + return new PagedIterable<>(listAsync(groupName, serviceName, taskType)); + } + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String taskType, + Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, taskType, context)); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String groupName, String serviceName, + String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, taskName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String groupName, String serviceName, + String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, taskName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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 createOrUpdateWithResponse(groupName, serviceName, taskName, parameters, Context.NONE).getValue(); + } + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String serviceName, String taskName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, taskName, this.client.getApiVersion(), expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String serviceName, String taskName, + String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, taskName, + this.client.getApiVersion(), expand, accept, context); + } + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String taskName) { + final String expand = null; + return getWithResponseAsync(groupName, serviceName, taskName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String groupName, String serviceName, String taskName, + String expand, Context context) { + return getWithResponseAsync(groupName, serviceName, taskName, expand, context).block(); + } + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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 getWithResponse(groupName, serviceName, taskName, expand, Context.NONE).getValue(); + } + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String groupName, String serviceName, String taskName, + Boolean deleteRunningTasks) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, taskName, this.client.getApiVersion(), deleteRunningTasks, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String groupName, String serviceName, String taskName, + Boolean deleteRunningTasks, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + taskName, this.client.getApiVersion(), deleteRunningTasks, accept, context); + } + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String taskName) { + final Boolean deleteRunningTasks = null; + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String groupName, String serviceName, String taskName, + Boolean deleteRunningTasks, Context context) { + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks, context).block(); + } + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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; + deleteWithResponse(groupName, serviceName, taskName, deleteRunningTasks, Context.NONE); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String groupName, String serviceName, + String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, taskName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String groupName, String serviceName, + String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + taskName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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 updateWithResponse(groupName, serviceName, taskName, parameters, Context.NONE).getValue(); + } + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String groupName, String serviceName, + String taskName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), + groupName, serviceName, taskName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String groupName, String serviceName, + String taskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + taskName, this.client.getApiVersion(), accept, context); + } + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String groupName, String serviceName, String taskName) { + return cancelWithResponseAsync(groupName, serviceName, taskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String groupName, String serviceName, String taskName, + Context context) { + return cancelWithResponseAsync(groupName, serviceName, taskName, context).block(); + } + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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 cancelWithResponse(groupName, serviceName, taskName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java new file mode 100644 index 000000000000..4d1cb08619c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; + +public final class ServiceTasksImpl implements ServiceTasks { + private static final ClientLogger LOGGER = new ClientLogger(ServiceTasksImpl.class); + + private final ServiceTasksClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ServiceTasksImpl(ServiceTasksClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + 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 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 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 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 deleteWithResponse(String groupName, String serviceName, String taskName, + Boolean deleteRunningTasks, Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, taskName, deleteRunningTasks, context); + } + + public void delete(String groupName, String serviceName, String taskName) { + this.serviceClient().delete(groupName, serviceName, taskName); + } + + 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 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 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; + } + } + + 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; + } + } + + 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 1c067422ec44..fc8baad6660f 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 @@ -155,7 +155,7 @@ Mono> listSkus(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/checkNameAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> nestedCheckNameAvailability(@HostParam("$host") String endpoint, + Mono> checkChildrenNameAvailability(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupName") String groupName, @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, @BodyParam("application/json") NameAvailabilityRequest parameters, @HeaderParam("Accept") String accept, @@ -182,9 +182,10 @@ Mono> list(@HostParam("$host") String endpoin @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, @BodyParam("application/json") NameAvailabilityRequest parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NameAvailabilityRequest parameters, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -211,13 +212,13 @@ Mono> listNext( } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -227,8 +228,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String groupName, String serviceName, @@ -260,13 +261,13 @@ private Mono>> createOrUpdateWithResponseAsync(String } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -277,8 +278,8 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String groupName, String serviceName, @@ -309,13 +310,13 @@ private Mono>> createOrUpdateWithResponseAsync(String } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -325,7 +326,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> @@ -337,13 +338,13 @@ private Mono>> createOrUpdateWithResponseAsync(String } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -354,7 +355,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> beginCreateOrUpdateAsync( @@ -367,13 +368,13 @@ private PollerFlux, DataMigrationServiceIn } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -383,7 +384,7 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> @@ -392,13 +393,13 @@ private PollerFlux, DataMigrationServiceIn } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -409,7 +410,7 @@ private PollerFlux, DataMigrationServiceIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( @@ -418,13 +419,13 @@ public SyncPoller, DataMigrationServiceInn } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -434,7 +435,7 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource on successful completion of {@link Mono}. + * @return an Azure Database Migration Service (classic) resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String groupName, String serviceName, @@ -444,13 +445,13 @@ private Mono createOrUpdateAsync(String groupName, St } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -461,7 +462,7 @@ private Mono createOrUpdateAsync(String groupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource on successful completion of {@link Mono}. + * @return an Azure Database Migration Service (classic) resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String groupName, String serviceName, @@ -471,13 +472,13 @@ private Mono createOrUpdateAsync(String groupName, St } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -487,7 +488,7 @@ private Mono createOrUpdateAsync(String groupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, @@ -496,13 +497,13 @@ public DataMigrationServiceInner createOrUpdate(String groupName, String service } /** - * Create or update DMS Instance + * Create or update DMS (classic) Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PUT method - * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. - * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, - * although other kinds may be added in the future. This method can change the kind, SKU, and network of the - * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PUT method creates a new service or updates an existing one. When a service is updated, existing child + * resources (i.e. tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based + * service, although other kinds may be added in the future. This method can change the kind, SKU, and network of + * the service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations * use the provisioningState property. * @@ -513,7 +514,7 @@ public DataMigrationServiceInner createOrUpdate(String groupName, String service * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataMigrationServiceInner createOrUpdate(String groupName, String serviceName, @@ -522,18 +523,18 @@ public DataMigrationServiceInner createOrUpdate(String groupName, String service } /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String groupName, @@ -560,10 +561,10 @@ private Mono> getByResourceGroupWithResponse } /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -571,8 +572,8 @@ private Mono> getByResourceGroupWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String groupName, @@ -598,17 +599,17 @@ private Mono> getByResourceGroupWithResponse } /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 a Database Migration Service resource on successful completion of {@link Mono}. + * @return an Azure Database Migration Service (classic) resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String groupName, String serviceName) { @@ -617,10 +618,10 @@ private Mono getByResourceGroupAsync(String groupName } /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -628,7 +629,7 @@ private Mono getByResourceGroupAsync(String groupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String groupName, String serviceName, @@ -637,17 +638,17 @@ public Response getByResourceGroupWithResponse(String } /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) { @@ -655,10 +656,10 @@ public DataMigrationServiceInner getByResourceGroup(String groupName, String ser } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -693,10 +694,10 @@ private Mono>> deleteWithResponseAsync(String groupNam } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -731,10 +732,10 @@ private Mono>> deleteWithResponseAsync(String groupNam } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -753,10 +754,10 @@ private PollerFlux, Void> beginDeleteAsync(String groupName, St } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -774,10 +775,10 @@ private PollerFlux, Void> beginDeleteAsync(String groupName, St } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -799,10 +800,10 @@ private PollerFlux, Void> beginDeleteAsync(String groupName, St } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -818,10 +819,10 @@ public SyncPoller, Void> beginDelete(String groupName, String s } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -839,10 +840,10 @@ public SyncPoller, Void> beginDelete(String groupName, String s } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -859,10 +860,10 @@ private Mono deleteAsync(String groupName, String serviceName, Boolean del } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -879,10 +880,10 @@ private Mono deleteAsync(String groupName, String serviceName) { } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -900,10 +901,10 @@ private Mono deleteAsync(String groupName, String serviceName, Boolean del } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -918,10 +919,10 @@ public void delete(String groupName, String serviceName) { } /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -937,11 +938,12 @@ public void delete(String groupName, String serviceName, Boolean deleteRunningTa } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -949,8 +951,8 @@ public void delete(String groupName, String serviceName, Boolean deleteRunningTa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String groupName, String serviceName, @@ -982,11 +984,12 @@ private Mono>> updateWithResponseAsync(String groupNam } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -995,8 +998,8 @@ private Mono>> updateWithResponseAsync(String groupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String groupName, String serviceName, @@ -1027,11 +1030,12 @@ private Mono>> updateWithResponseAsync(String groupNam } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1039,7 +1043,7 @@ private Mono>> updateWithResponseAsync(String groupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> @@ -1051,11 +1055,12 @@ private Mono>> updateWithResponseAsync(String groupNam } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1064,7 +1069,7 @@ private Mono>> updateWithResponseAsync(String groupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Database Migration Service resource. + * @return the {@link PollerFlux} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DataMigrationServiceInner> @@ -1076,11 +1081,12 @@ private Mono>> updateWithResponseAsync(String groupNam } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1088,7 +1094,7 @@ private Mono>> updateWithResponseAsync(String groupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginUpdate(String groupName, @@ -1097,11 +1103,12 @@ public SyncPoller, DataMigrationServiceInn } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1110,7 +1117,7 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a Database Migration Service resource. + * @return the {@link SyncPoller} for polling of an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DataMigrationServiceInner> beginUpdate(String groupName, @@ -1119,11 +1126,12 @@ public SyncPoller, DataMigrationServiceInn } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1131,7 +1139,7 @@ public SyncPoller, DataMigrationServiceInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource on successful completion of {@link Mono}. + * @return an Azure Database Migration Service (classic) resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String groupName, String serviceName, @@ -1141,11 +1149,12 @@ private Mono updateAsync(String groupName, String ser } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1154,7 +1163,7 @@ private Mono updateAsync(String groupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource on successful completion of {@link Mono}. + * @return an Azure Database Migration Service (classic) resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String groupName, String serviceName, @@ -1164,11 +1173,12 @@ private Mono updateAsync(String groupName, String ser } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1176,7 +1186,7 @@ private Mono updateAsync(String groupName, String ser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataMigrationServiceInner update(String groupName, String serviceName, @@ -1185,11 +1195,12 @@ public DataMigrationServiceInner update(String groupName, String serviceName, } /** - * Create or update DMS Service Instance + * Create or update DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method - * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are - * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, + * but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1198,7 +1209,7 @@ public DataMigrationServiceInner update(String groupName, String serviceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters, @@ -1209,8 +1220,8 @@ public DataMigrationServiceInner update(String groupName, String serviceName, Da /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1246,8 +1257,8 @@ private Mono> checkStatusWithR /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1283,8 +1294,8 @@ private Mono> checkStatusWithR /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1301,8 +1312,8 @@ private Mono checkStatusAsync(String gr /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1321,8 +1332,8 @@ public Response checkStatusWithResponse /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1339,8 +1350,8 @@ public DataMigrationServiceStatusResponseInner checkStatus(String groupName, Str /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1375,8 +1386,8 @@ private Mono>> startWithResponseAsync(String groupName /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1412,8 +1423,8 @@ private Mono>> startWithResponseAsync(String groupName /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1432,8 +1443,8 @@ private PollerFlux, Void> beginStartAsync(String groupName, Str /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1454,8 +1465,8 @@ private PollerFlux, Void> beginStartAsync(String groupName, Str /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1472,8 +1483,8 @@ public SyncPoller, Void> beginStart(String groupName, String se /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1491,8 +1502,8 @@ public SyncPoller, Void> beginStart(String groupName, String se /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1509,8 +1520,8 @@ private Mono startAsync(String groupName, String serviceName) { /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1528,8 +1539,8 @@ private Mono startAsync(String groupName, String serviceName, Context cont /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1545,8 +1556,8 @@ public void start(String groupName, String serviceName) { /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1563,9 +1574,9 @@ public void start(String groupName, String serviceName, Context context) { /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1600,9 +1611,9 @@ private Mono>> stopWithResponseAsync(String groupName, /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1638,9 +1649,9 @@ private Mono>> stopWithResponseAsync(String groupName, /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1659,9 +1670,9 @@ private PollerFlux, Void> beginStopAsync(String groupName, Stri /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1682,9 +1693,9 @@ private PollerFlux, Void> beginStopAsync(String groupName, Stri /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1701,9 +1712,9 @@ public SyncPoller, Void> beginStop(String groupName, String ser /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1721,9 +1732,9 @@ public SyncPoller, Void> beginStop(String groupName, String ser /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1740,9 +1751,9 @@ private Mono stopAsync(String groupName, String serviceName) { /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1760,9 +1771,9 @@ private Mono stopAsync(String groupName, String serviceName, Context conte /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1778,9 +1789,9 @@ public void stop(String groupName, String serviceName) { /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1797,8 +1808,8 @@ public void stop(String groupName, String serviceName, Context context) { /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1836,8 +1847,8 @@ private Mono> listSkusSinglePageAsync(St /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1876,8 +1887,8 @@ private Mono> listSkusSinglePageAsync(St /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1895,8 +1906,8 @@ private PagedFlux listSkusAsync(String groupName, Stri /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1915,8 +1926,8 @@ private PagedFlux listSkusAsync(String groupName, Stri /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1933,8 +1944,8 @@ public PagedIterable listSkus(String groupName, String /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1964,8 +1975,8 @@ public PagedIterable listSkus(String groupName, String * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> nestedCheckNameAvailabilityWithResponseAsync(String groupName, - String serviceName, NameAvailabilityRequest parameters) { + private Mono> checkChildrenNameAvailabilityWithResponseAsync( + String groupName, String serviceName, NameAvailabilityRequest parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1987,7 +1998,7 @@ private Mono> nestedCheckNameAvailabilit } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.nestedCheckNameAvailability(this.client.getEndpoint(), + .withContext(context -> service.checkChildrenNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, this.client.getApiVersion(), serviceName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -2009,8 +2020,8 @@ private Mono> nestedCheckNameAvailabilit * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> nestedCheckNameAvailabilityWithResponseAsync(String groupName, - String serviceName, NameAvailabilityRequest parameters, Context context) { + private Mono> checkChildrenNameAvailabilityWithResponseAsync( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2032,7 +2043,7 @@ private Mono> nestedCheckNameAvailabilit } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.nestedCheckNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + return service.checkChildrenNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, this.client.getApiVersion(), serviceName, parameters, accept, context); } @@ -2050,9 +2061,9 @@ private Mono> nestedCheckNameAvailabilit * @return indicates whether a proposed resource name is available on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono nestedCheckNameAvailabilityAsync(String groupName, String serviceName, + private Mono checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) { - return nestedCheckNameAvailabilityWithResponseAsync(groupName, serviceName, parameters) + return checkChildrenNameAvailabilityWithResponseAsync(groupName, serviceName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -2071,9 +2082,9 @@ private Mono nestedCheckNameAvailabilityAsync(Str * @return indicates whether a proposed resource name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response nestedCheckNameAvailabilityWithResponse(String groupName, + 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(); } /** @@ -2090,16 +2101,16 @@ public Response nestedCheckNameAvailabilityWithRe * @return indicates whether a proposed resource name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityResponseInner nestedCheckNameAvailability(String groupName, String serviceName, + public NameAvailabilityResponseInner checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters) { - return nestedCheckNameAvailabilityWithResponse(groupName, serviceName, parameters, Context.NONE).getValue(); + return checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, Context.NONE).getValue(); } /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2132,8 +2143,8 @@ private Mono> listByResourceGroupSingle /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @param context The context to associate with this operation. @@ -2168,8 +2179,8 @@ private Mono> listByResourceGroupSingle /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2186,8 +2197,8 @@ private PagedFlux listByResourceGroupAsync(String gro /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @param context The context to associate with this operation. @@ -2205,8 +2216,8 @@ private PagedFlux listByResourceGroupAsync(String gro /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2222,8 +2233,8 @@ public PagedIterable listByResourceGroup(String group /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @param context The context to associate with this operation. @@ -2240,8 +2251,8 @@ public PagedIterable listByResourceGroup(String group /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2269,8 +2280,8 @@ private Mono> listSinglePageAsync() { /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2300,8 +2311,8 @@ private Mono> listSinglePageAsync(Conte /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2315,8 +2326,8 @@ private PagedFlux listAsync() { /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2333,8 +2344,8 @@ private PagedFlux listAsync(Context context) { /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2348,8 +2359,8 @@ public PagedIterable list() { /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2397,7 +2408,7 @@ private Mono> checkNameAvailabilityWithR final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, parameters, accept, context)) + this.client.getSubscriptionId(), location, this.client.getApiVersion(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2436,8 +2447,8 @@ private Mono> checkNameAvailabilityWithR } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, parameters, accept, context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), 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 709ba85b8ef0..5a5a073431ec 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 @@ -110,10 +110,10 @@ public PagedIterable listSkus(String groupName, String serv return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableServiceSkuImpl(inner1, this.manager())); } - public Response nestedCheckNameAvailabilityWithResponse(String groupName, + public Response checkChildrenNameAvailabilityWithResponse(String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { - Response inner - = this.serviceClient().nestedCheckNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + Response inner = this.serviceClient() + .checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NameAvailabilityResponseImpl(inner.getValue(), this.manager())); @@ -122,10 +122,10 @@ public Response nestedCheckNameAvailabilityWithRespons } } - public NameAvailabilityResponse nestedCheckNameAvailability(String groupName, String serviceName, + 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 { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java new file mode 100644 index 000000000000..bb823ea93589 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServiceImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; +import com.azure.resourcemanager.datamigration.models.DeleteNode; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; +import com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated; +import java.util.Collections; +import java.util.Map; + +public final class SqlMigrationServiceImpl + implements SqlMigrationService, SqlMigrationService.Definition, SqlMigrationService.Update { + private SqlMigrationServiceInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemDataAutoGenerated systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String integrationRuntimeState() { + return this.innerModel().integrationRuntimeState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SqlMigrationServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sqlMigrationServiceName; + + private SqlMigrationServiceUpdate updateParameters; + + public SqlMigrationServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SqlMigrationService create() { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .createOrUpdate(resourceGroupName, sqlMigrationServiceName, this.innerModel(), Context.NONE); + return this; + } + + public SqlMigrationService create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .createOrUpdate(resourceGroupName, sqlMigrationServiceName, this.innerModel(), context); + return this; + } + + SqlMigrationServiceImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new SqlMigrationServiceInner(); + this.serviceManager = serviceManager; + this.sqlMigrationServiceName = name; + } + + public SqlMigrationServiceImpl update() { + this.updateParameters = new SqlMigrationServiceUpdate(); + return this; + } + + public SqlMigrationService apply() { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .update(resourceGroupName, sqlMigrationServiceName, updateParameters, Context.NONE); + return this; + } + + public SqlMigrationService apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .update(resourceGroupName, sqlMigrationServiceName, updateParameters, context); + return this; + } + + SqlMigrationServiceImpl(SqlMigrationServiceInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sqlMigrationServiceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sqlMigrationServices"); + } + + public SqlMigrationService refresh() { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE) + .getValue(); + return this; + } + + public SqlMigrationService refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSqlMigrationServices() + .getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context) + .getValue(); + return this; + } + + public Response listAuthKeysWithResponse(Context context) { + return serviceManager.sqlMigrationServices() + .listAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public AuthenticationKeys listAuthKeys() { + return serviceManager.sqlMigrationServices().listAuthKeys(resourceGroupName, sqlMigrationServiceName); + } + + public Response regenerateAuthKeysWithResponse(RegenAuthKeysInner parameters, Context context) { + return serviceManager.sqlMigrationServices() + .regenerateAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + } + + public RegenAuthKeys regenerateAuthKeys(RegenAuthKeysInner parameters) { + return serviceManager.sqlMigrationServices() + .regenerateAuthKeys(resourceGroupName, sqlMigrationServiceName, parameters); + } + + public Response deleteNodeWithResponse(DeleteNodeInner parameters, Context context) { + return serviceManager.sqlMigrationServices() + .deleteNodeWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + } + + public DeleteNode deleteNode(DeleteNodeInner parameters) { + return serviceManager.sqlMigrationServices().deleteNode(resourceGroupName, sqlMigrationServiceName, parameters); + } + + public Response listMonitoringDataWithResponse(Context context) { + return serviceManager.sqlMigrationServices() + .listMonitoringDataWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public IntegrationRuntimeMonitoringData listMonitoringData() { + return serviceManager.sqlMigrationServices().listMonitoringData(resourceGroupName, sqlMigrationServiceName); + } + + public SqlMigrationServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlMigrationServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlMigrationServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java new file mode 100644 index 000000000000..00c6ffd35cbb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesClientImpl.java @@ -0,0 +1,2156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationListResult; +import com.azure.resourcemanager.datamigration.models.SqlMigrationListResult; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServiceUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlMigrationServicesClient. + */ +public final class SqlMigrationServicesClientImpl implements SqlMigrationServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SqlMigrationServicesService service; + + /** + * The service client containing this operation class. + */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of SqlMigrationServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlMigrationServicesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(SqlMigrationServicesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientSqlMigrationServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + public interface SqlMigrationServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlMigrationServiceInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SqlMigrationServiceUpdate parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listAuthKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthKeys(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/regenerateAuthKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateAuthKeys(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RegenAuthKeysInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/deleteNode") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteNode(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DeleteNodeInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMigrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrations(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataMigration/sqlMigrationServices/{sqlMigrationServiceName}/listMonitoringData") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMonitoringData(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sqlMigrationServiceName") String sqlMigrationServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/sqlMigrationServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMigrationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String sqlMigrationServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + return getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE).getValue(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SqlMigrationServiceInner.class, SqlMigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SqlMigrationServiceInner.class, SqlMigrationServiceInner.class, context); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginCreateOrUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceInner parameters, + Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner createOrUpdate(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Create or Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner createOrUpdate(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String sqlMigrationServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sqlMigrationServiceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName) { + return this.beginDeleteAsync(resourceGroupName, sqlMigrationServiceName).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sqlMigrationServiceName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, sqlMigrationServiceName, context).getSyncPoller(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlMigrationServiceName) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sqlMigrationServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, sqlMigrationServiceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlMigrationServiceName) { + deleteAsync(resourceGroupName, sqlMigrationServiceName).block(); + } + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sqlMigrationServiceName, Context context) { + deleteAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SqlMigrationServiceInner.class, SqlMigrationServiceInner.class, + this.client.getContext()); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SqlMigrationServiceInner> beginUpdateAsync( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SqlMigrationServiceInner.class, SqlMigrationServiceInner.class, context); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> + beginUpdate(String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters) { + return this.beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SqlMigrationServiceInner> beginUpdate( + String resourceGroupName, String sqlMigrationServiceName, SqlMigrationServiceUpdate parameters, + Context context) { + return this.beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).getSyncPoller(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner update(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters) { + return updateAsync(resourceGroupName, sqlMigrationServiceName, parameters).block(); + } + + /** + * Update Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlMigrationServiceInner update(String resourceGroupName, String sqlMigrationServiceName, + SqlMigrationServiceUpdate parameters, Context context) { + return updateAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthKeysWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAuthKeys(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAuthKeysWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAuthKeys(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAuthKeysAsync(String resourceGroupName, String sqlMigrationServiceName) { + return listAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAuthKeysWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + return listAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthenticationKeysInner listAuthKeys(String resourceGroupName, String sqlMigrationServiceName) { + return listAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE).getValue(); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateAuthKeysWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, RegenAuthKeysInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateAuthKeys(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateAuthKeysWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.regenerateAuthKeys(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateAuthKeysAsync(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters) { + return regenerateAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateAuthKeysWithResponse(String resourceGroupName, + String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + return regenerateAuthKeysWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context) + .block(); + } + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegenAuthKeysInner regenerateAuthKeys(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters) { + return regenerateAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, Context.NONE) + .getValue(); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNodeWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, DeleteNodeInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.deleteNode(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteNodeWithResponseAsync(String resourceGroupName, + String sqlMigrationServiceName, DeleteNodeInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteNode(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters) { + return deleteNodeWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNodeWithResponse(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters, Context context) { + return deleteNodeWithResponseAsync(resourceGroupName, sqlMigrationServiceName, parameters, context).block(); + } + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeleteNodeInner deleteNode(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters) { + return deleteNodeWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, Context.NONE).getValue(); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync(String resourceGroupName, + String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMigrations(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsSinglePageAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listMigrations(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync(String resourceGroupName, + String sqlMigrationServiceName) { + return new PagedFlux<>(() -> listMigrationsSinglePageAsync(resourceGroupName, sqlMigrationServiceName), + nextLink -> listMigrationsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMigrationsAsync(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + return new PagedFlux<>(() -> listMigrationsSinglePageAsync(resourceGroupName, sqlMigrationServiceName, context), + nextLink -> listMigrationsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations(String resourceGroupName, + String sqlMigrationServiceName) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, sqlMigrationServiceName)); + } + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMigrations(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + return new PagedIterable<>(listMigrationsAsync(resourceGroupName, sqlMigrationServiceName, context)); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMonitoringDataWithResponseAsync(String resourceGroupName, String sqlMigrationServiceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMonitoringData(this.client.getEndpoint(), resourceGroupName, + sqlMigrationServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMonitoringDataWithResponseAsync(String resourceGroupName, String sqlMigrationServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sqlMigrationServiceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sqlMigrationServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMonitoringData(this.client.getEndpoint(), resourceGroupName, sqlMigrationServiceName, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listMonitoringDataAsync(String resourceGroupName, + String sqlMigrationServiceName) { + return listMonitoringDataWithResponseAsync(resourceGroupName, sqlMigrationServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listMonitoringDataWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + return listMonitoringDataWithResponseAsync(resourceGroupName, sqlMigrationServiceName, context).block(); + } + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeMonitoringDataInner listMonitoringData(String resourceGroupName, + String sqlMigrationServiceName) { + return listMonitoringDataWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE).getValue(); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMigrationsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMigrationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.java new file mode 100644 index 000000000000..095f532273b4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/SqlMigrationServicesImpl.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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.SqlMigrationServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.AuthenticationKeys; +import com.azure.resourcemanager.datamigration.models.DatabaseMigration; +import com.azure.resourcemanager.datamigration.models.DeleteNode; +import com.azure.resourcemanager.datamigration.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.datamigration.models.RegenAuthKeys; +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import com.azure.resourcemanager.datamigration.models.SqlMigrationServices; + +public final class SqlMigrationServicesImpl implements SqlMigrationServices { + private static final ClientLogger LOGGER = new ClientLogger(SqlMigrationServicesImpl.class); + + private final SqlMigrationServicesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public SqlMigrationServicesImpl(SqlMigrationServicesClient innerClient, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SqlMigrationServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlMigrationService getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + SqlMigrationServiceInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new SqlMigrationServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sqlMigrationServiceName) { + this.serviceClient().delete(resourceGroupName, sqlMigrationServiceName); + } + + public void delete(String resourceGroupName, String sqlMigrationServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, sqlMigrationServiceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public Response listAuthKeysWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + Response inner + = this.serviceClient().listAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AuthenticationKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AuthenticationKeys listAuthKeys(String resourceGroupName, String sqlMigrationServiceName) { + AuthenticationKeysInner inner = this.serviceClient().listAuthKeys(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new AuthenticationKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateAuthKeysWithResponse(String resourceGroupName, + String sqlMigrationServiceName, RegenAuthKeysInner parameters, Context context) { + Response inner = this.serviceClient() + .regenerateAuthKeysWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RegenAuthKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegenAuthKeys regenerateAuthKeys(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters) { + RegenAuthKeysInner inner + = this.serviceClient().regenerateAuthKeys(resourceGroupName, sqlMigrationServiceName, parameters); + if (inner != null) { + return new RegenAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteNodeWithResponse(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters, Context context) { + Response inner = this.serviceClient() + .deleteNodeWithResponse(resourceGroupName, sqlMigrationServiceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeleteNodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeleteNode deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters) { + DeleteNodeInner inner = this.serviceClient().deleteNode(resourceGroupName, sqlMigrationServiceName, parameters); + if (inner != null) { + return new DeleteNodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName) { + PagedIterable inner + = this.serviceClient().listMigrations(resourceGroupName, sqlMigrationServiceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseMigrationImpl(inner1, this.manager())); + } + + public PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName, + Context context) { + PagedIterable inner + = this.serviceClient().listMigrations(resourceGroupName, sqlMigrationServiceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DatabaseMigrationImpl(inner1, this.manager())); + } + + public Response listMonitoringDataWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context) { + Response inner + = this.serviceClient().listMonitoringDataWithResponse(resourceGroupName, sqlMigrationServiceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IntegrationRuntimeMonitoringDataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IntegrationRuntimeMonitoringData listMonitoringData(String resourceGroupName, + String sqlMigrationServiceName) { + IntegrationRuntimeMonitoringDataInner inner + = this.serviceClient().listMonitoringData(resourceGroupName, sqlMigrationServiceName); + if (inner != null) { + return new IntegrationRuntimeMonitoringDataImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SqlMigrationServiceImpl(inner1, this.manager())); + } + + public SqlMigrationService getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sqlMigrationServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", id))); + } + this.delete(resourceGroupName, sqlMigrationServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sqlMigrationServiceName = ResourceManagerUtils.getValueFromIdByName(id, "sqlMigrationServices"); + if (sqlMigrationServiceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlMigrationServices'.", id))); + } + this.delete(resourceGroupName, sqlMigrationServiceName, context); + } + + private SqlMigrationServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public SqlMigrationServiceImpl define(String name) { + return new SqlMigrationServiceImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java index abeff6ff48b7..7dd2e529c0fa 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 @@ -31,6 +31,7 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; 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; @@ -129,6 +130,17 @@ Mono> cancel(@HostParam("$host") String endpoint, @PathParam("taskName") String taskName, @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}/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 }) @@ -140,9 +152,9 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = true) /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -185,9 +197,9 @@ private Mono> listSinglePageAsync(String groupNa /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -231,9 +243,9 @@ private Mono> listSinglePageAsync(String groupNa /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -254,9 +266,9 @@ private PagedFlux listAsync(String groupName, String serviceNa /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -276,9 +288,9 @@ private PagedFlux listAsync(String groupName, String serviceNa /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -300,9 +312,9 @@ private PagedFlux listAsync(String groupName, String serviceNa /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -321,9 +333,9 @@ public PagedIterable list(String groupName, String serviceName /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -344,9 +356,9 @@ public PagedIterable list(String groupName, String serviceName /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -397,9 +409,9 @@ private Mono> createOrUpdateWithResponseAsync(String /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -449,9 +461,9 @@ private Mono> createOrUpdateWithResponseAsync(String /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -473,9 +485,9 @@ private Mono createOrUpdateAsync(String groupName, String serv /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -498,9 +510,9 @@ public Response createOrUpdateWithResponse(String groupName, S /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method - * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is - * little reason to update an existing one. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PUT method creates a new task or updates an existing one, although since 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. @@ -522,8 +534,8 @@ public ProjectTaskInner createOrUpdate(String groupName, String serviceName, Str /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -568,8 +580,8 @@ private Mono> getWithResponseAsync(String groupName, /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -614,8 +626,8 @@ private Mono> getWithResponseAsync(String groupName, /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -636,8 +648,8 @@ private Mono getAsync(String groupName, String serviceName, St /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -659,8 +671,8 @@ public Response getWithResponse(String groupName, String servi /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -680,8 +692,8 @@ public ProjectTaskInner get(String groupName, String serviceName, String project /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -727,8 +739,8 @@ private Mono> deleteWithResponseAsync(String groupName, String se /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -773,8 +785,8 @@ private Mono> deleteWithResponseAsync(String groupName, String se /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -795,8 +807,8 @@ private Mono deleteAsync(String groupName, String serviceName, String proj /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -819,8 +831,8 @@ public Response deleteWithResponse(String groupName, String serviceName, S /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -839,9 +851,9 @@ public void delete(String groupName, String serviceName, String projectName, Str /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -892,9 +904,9 @@ private Mono> updateWithResponseAsync(String groupNam /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -944,9 +956,9 @@ private Mono> updateWithResponseAsync(String groupNam /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -968,9 +980,9 @@ private Mono updateAsync(String groupName, String serviceName, /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -992,9 +1004,9 @@ public Response updateWithResponse(String groupName, String se /** * Create or update task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH - * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do - * so. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * PATCH method updates an existing task, but since 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. @@ -1015,8 +1027,8 @@ public ProjectTaskInner update(String groupName, String serviceName, String proj /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1060,8 +1072,8 @@ private Mono> cancelWithResponseAsync(String groupNam /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1105,8 +1117,8 @@ private Mono> cancelWithResponseAsync(String groupNam /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1127,8 +1139,8 @@ private Mono cancelAsync(String groupName, String serviceName, /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1149,8 +1161,8 @@ public Response cancelWithResponse(String groupName, String se /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -1166,6 +1178,179 @@ public ProjectTaskInner cancel(String groupName, String serviceName, String proj return cancelWithResponse(groupName, serviceName, projectName, taskName, Context.NONE).getValue(); } + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync(String groupName, String serviceName, + String projectName, String taskName, CommandPropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.command(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, + serviceName, projectName, taskName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync(String groupName, String serviceName, + String projectName, String taskName, CommandPropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.command(this.client.getEndpoint(), this.client.getSubscriptionId(), groupName, serviceName, + projectName, taskName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commandAsync(String groupName, String serviceName, String projectName, + String taskName, CommandPropertiesInner parameters) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response commandWithResponse(String groupName, String serviceName, + String projectName, String taskName, CommandPropertiesInner parameters, Context context) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, parameters, context).block(); + } + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommandPropertiesInner command(String groupName, String serviceName, String projectName, String taskName, + CommandPropertiesInner parameters) { + return commandWithResponse(groupName, serviceName, projectName, taskName, parameters, Context.NONE).getValue(); + } + /** * 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 c6aefeed1cb7..a408544debc0 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; @@ -91,6 +93,29 @@ public ProjectTask cancel(String groupName, String serviceName, String projectNa } } + 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 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 ProjectTask getById(String id) { String groupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (groupName == null) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java index 09c69f6c7d66..645188fc76cb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java @@ -80,7 +80,8 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = true /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,7 +114,8 @@ private Mono> listSinglePageAsync(String location) { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @param context The context to associate with this operation. @@ -147,7 +149,8 @@ private Mono> listSinglePageAsync(String location, Con /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -163,7 +166,8 @@ private PagedFlux listAsync(String location) { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @param context The context to associate with this operation. @@ -181,7 +185,8 @@ private PagedFlux listAsync(String location, Context context) { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -197,7 +202,8 @@ public PagedIterable list(String location) { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @param context The context to associate with this operation. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthType.java new file mode 100644 index 000000000000..e6f6658860e9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthType.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; + +/** + * Authentication type used for accessing Azure Blob Storage. + */ +public enum AuthType { + /** + * Enum value AccountKey. + */ + ACCOUNT_KEY("AccountKey"), + + /** + * Enum value ManagedIdentity. + */ + MANAGED_IDENTITY("ManagedIdentity"); + + /** + * The actual serialized value for a AuthType instance. + */ + private final String value; + + AuthType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AuthType instance. + * + * @param value the serialized value to parse. + * @return the parsed AuthType object, or null if unable to parse. + */ + public static AuthType fromString(String value) { + if (value == null) { + return null; + } + AuthType[] items = AuthType.values(); + for (AuthType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java new file mode 100644 index 000000000000..fba8aadeb4ec --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationKeys.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner; + +/** + * An immutable client-side representation of AuthenticationKeys. + */ +public interface AuthenticationKeys { + /** + * Gets the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + String authKey1(); + + /** + * Gets the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + String authKey2(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.AuthenticationKeysInner object. + * + * @return the inner object. + */ + AuthenticationKeysInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java index 7981fb05b1ed..671d47ef0a8a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuSku.java @@ -32,7 +32,7 @@ public final class AvailableServiceSkuSku implements JsonSerializable { + /* + * Authentication type used for accessing Azure Blob Storage. + */ + private AuthType authType; + + /* + * Identity details for authentication using a Managed Identity. + */ + private ManagedServiceIdentity identity; + + /* + * Resource Id of the storage account where backups are stored. + */ + private String storageAccountResourceId; + + /* + * Storage Account Key. + */ + private String accountKey; + + /* + * Blob container name where backups are stored. + */ + private String blobContainerName; + + /** + * Creates an instance of AzureBlob class. + */ + public AzureBlob() { + } + + /** + * Get the authType property: Authentication type used for accessing Azure Blob Storage. + * + * @return the authType value. + */ + public AuthType authType() { + return this.authType; + } + + /** + * Set the authType property: Authentication type used for accessing Azure Blob Storage. + * + * @param authType the authType value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withAuthType(AuthType authType) { + this.authType = authType; + return this; + } + + /** + * Get the identity property: Identity details for authentication using a Managed Identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity details for authentication using a Managed Identity. + * + * @param identity the identity value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the storageAccountResourceId property: Resource Id of the storage account where backups are stored. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Resource Id of the storage account where backups are stored. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the accountKey property: Storage Account Key. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage Account Key. + * + * @param accountKey the accountKey value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the blobContainerName property: Blob container name where backups are stored. + * + * @return the blobContainerName value. + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Set the blobContainerName property: Blob container name where backups are stored. + * + * @param blobContainerName the blobContainerName value to set. + * @return the AzureBlob object itself. + */ + public AzureBlob withBlobContainerName(String blobContainerName) { + this.blobContainerName = blobContainerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("storageAccountResourceId", this.storageAccountResourceId); + jsonWriter.writeStringField("accountKey", this.accountKey); + jsonWriter.writeStringField("blobContainerName", this.blobContainerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlob if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AzureBlob. + */ + public static AzureBlob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlob deserializedAzureBlob = new AzureBlob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedAzureBlob.authType = AuthType.fromString(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedAzureBlob.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("storageAccountResourceId".equals(fieldName)) { + deserializedAzureBlob.storageAccountResourceId = reader.getString(); + } else if ("accountKey".equals(fieldName)) { + deserializedAzureBlob.accountKey = reader.getString(); + } else if ("blobContainerName".equals(fieldName)) { + deserializedAzureBlob.blobContainerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlob; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java new file mode 100644 index 000000000000..e2588fd1b3cf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupConfiguration.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Backup Configuration. + */ +@Fluent +public final class BackupConfiguration implements JsonSerializable { + /* + * Source location of backups. + */ + private SourceLocation sourceLocation; + + /* + * Target location for copying backups. + */ + private TargetLocation targetLocation; + + /** + * Creates an instance of BackupConfiguration class. + */ + public BackupConfiguration() { + } + + /** + * Get the sourceLocation property: Source location of backups. + * + * @return the sourceLocation value. + */ + public SourceLocation sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation property: Source location of backups. + * + * @param sourceLocation the sourceLocation value to set. + * @return the BackupConfiguration object itself. + */ + public BackupConfiguration withSourceLocation(SourceLocation sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the targetLocation property: Target location for copying backups. + * + * @return the targetLocation value. + */ + public TargetLocation targetLocation() { + return this.targetLocation; + } + + /** + * Set the targetLocation property: Target location for copying backups. + * + * @param targetLocation the targetLocation value to set. + * @return the BackupConfiguration object itself. + */ + public BackupConfiguration withTargetLocation(TargetLocation targetLocation) { + this.targetLocation = targetLocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceLocation() != null) { + sourceLocation().validate(); + } + if (targetLocation() != null) { + targetLocation().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceLocation", this.sourceLocation); + jsonWriter.writeJsonField("targetLocation", this.targetLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupConfiguration. + */ + public static BackupConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupConfiguration deserializedBackupConfiguration = new BackupConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceLocation".equals(fieldName)) { + deserializedBackupConfiguration.sourceLocation = SourceLocation.fromJson(reader); + } else if ("targetLocation".equals(fieldName)) { + deserializedBackupConfiguration.targetLocation = TargetLocation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupConfiguration; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java index dcae6b35a8b2..d74de24b1977 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -54,14 +53,8 @@ public BlobShare withSasUri(String sasUri) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sasUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property sasUri in model BlobShare")); - } } - private static final ClientLogger LOGGER = new ClientLogger(BlobShare.class); - /** * {@inheritDoc} */ @@ -78,7 +71,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of BlobShare if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the BlobShare. */ public static BlobShare fromJson(JsonReader jsonReader) throws IOException { 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 000000000000..52aa6b082193 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for the service task to check for OCI drivers. + */ +@Fluent +public final class CheckOciDriverTaskInput implements JsonSerializable { + /* + * Version of the source server to check against. Optional. + */ + private String serverVersion; + + /** + * Creates an instance of CheckOciDriverTaskInput class. + */ + public CheckOciDriverTaskInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serverVersion", this.serverVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckOciDriverTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckOciDriverTaskInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckOciDriverTaskInput. + */ + public static CheckOciDriverTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckOciDriverTaskInput deserializedCheckOciDriverTaskInput = new CheckOciDriverTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serverVersion".equals(fieldName)) { + deserializedCheckOciDriverTaskInput.serverVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckOciDriverTaskInput; + }); + } +} 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 000000000000..168795eb978b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Output for the service task to check for OCI drivers. + */ +@Fluent +public final class CheckOciDriverTaskOutput implements JsonSerializable { + /* + * Information about the installed driver if found and valid. + */ + private OracleOciDriverInfo installedDriver; + + /* + * Validation errors + */ + private List validationErrors; + + /** + * Creates an instance of CheckOciDriverTaskOutput class. + */ + public CheckOciDriverTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("installedDriver", this.installedDriver); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckOciDriverTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckOciDriverTaskOutput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckOciDriverTaskOutput. + */ + public static CheckOciDriverTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckOciDriverTaskOutput deserializedCheckOciDriverTaskOutput = new CheckOciDriverTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("installedDriver".equals(fieldName)) { + deserializedCheckOciDriverTaskOutput.installedDriver = OracleOciDriverInfo.fromJson(reader); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedCheckOciDriverTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedCheckOciDriverTaskOutput; + }); + } +} 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 000000000000..fa254748dec5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that checks for OCI drivers. + */ +@Fluent +public final class CheckOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.SERVICE_CHECK_OCI; + + /* + * Input for the service task to check for OCI drivers. + */ + private CheckOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of CheckOciDriverTaskProperties class. + */ + public CheckOciDriverTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckOciDriverTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckOciDriverTaskProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckOciDriverTaskProperties. + */ + public static CheckOciDriverTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckOciDriverTaskProperties deserializedCheckOciDriverTaskProperties = new CheckOciDriverTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedCheckOciDriverTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedCheckOciDriverTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedCheckOciDriverTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedCheckOciDriverTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedCheckOciDriverTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedCheckOciDriverTaskProperties.input = CheckOciDriverTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> CheckOciDriverTaskOutput.fromJson(reader1)); + deserializedCheckOciDriverTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedCheckOciDriverTaskProperties; + }); + } +} 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 8e68a00589f1..e67500731b3e 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,164 +4,39 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; +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. + * An immutable client-side representation of CommandProperties. */ -@Immutable -public class CommandProperties implements JsonSerializable { - /* - * Command type. - */ - private String commandType = "CommandProperties"; - - /* - * Array of errors. This is ignored if submitted. - */ - private List errors; - - /* - * The state of the command. This is ignored if submitted. - */ - private CommandState state; - - /** - * Creates an instance of CommandProperties class. - */ - public CommandProperties() { - } - +public interface CommandProperties { /** - * Get the commandType property: Command type. + * Gets the commandType property: Command type. * * @return the commandType value. */ - public String commandType() { - return this.commandType; - } + CommandType commandType(); /** - * 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(); /** - * Set the errors property: Array of errors. This is ignored if submitted. - * - * @param errors the errors value to set. - * @return the CommandProperties object itself. - */ - CommandProperties withErrors(List errors) { - this.errors = errors; - return this; - } - - /** - * 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(); /** - * Set the state property: The state of the command. This is ignored if submitted. + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner object. * - * @param state the state value to set. - * @return the CommandProperties object itself. + * @return the inner object. */ - CommandProperties withState(CommandState state) { - this.state = state; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commandType", this.commandType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommandProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommandProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the CommandProperties. - */ - public static CommandProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("commandType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Migrate.Sync.Complete.Database".equals(discriminatorValue)) { - return MigrateSyncCompleteCommandProperties.fromJson(readerToUse.reset()); - } else if ("Migrate.SqlServer.AzureDbSqlMi.Complete".equals(discriminatorValue)) { - return MigrateMISyncCompleteCommandProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static CommandProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommandProperties deserializedCommandProperties = new CommandProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("commandType".equals(fieldName)) { - deserializedCommandProperties.commandType = reader.getString(); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedCommandProperties.errors = errors; - } else if ("state".equals(fieldName)) { - deserializedCommandProperties.state = CommandState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCommandProperties; - }); - } + CommandPropertiesInner innerModel(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java new file mode 100644 index 000000000000..d9bb828d6fe8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandType.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Command type. + */ +public final class CommandType extends ExpandableStringEnum { + /** + * Static value Migrate.Sync.Complete.Database for CommandType. + */ + public static final CommandType MIGRATE_SYNC_COMPLETE_DATABASE = fromString("Migrate.Sync.Complete.Database"); + + /** + * Static value Migrate.SqlServer.AzureDbSqlMi.Complete for CommandType. + */ + public static final CommandType MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE + = fromString("Migrate.SqlServer.AzureDbSqlMi.Complete"); + + /** + * Static value cancel for CommandType. + */ + public static final CommandType CANCEL = fromString("cancel"); + + /** + * Static value finish for CommandType. + */ + public static final CommandType FINISH = fromString("finish"); + + /** + * Static value restart for CommandType. + */ + public static final CommandType RESTART = fromString("restart"); + + /** + * Creates a new instance of CommandType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommandType() { + } + + /** + * Creates or finds a CommandType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommandType. + */ + public static CommandType fromString(String name) { + return fromString(name, CommandType.class); + } + + /** + * Gets known CommandType values. + * + * @return known CommandType values. + */ + public static Collection values() { + return values(CommandType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java new file mode 100644 index 000000000000..42abd40ca30d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates the connection to and provides information about a MongoDB server. + */ +@Fluent +public final class ConnectToMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.CONNECT_MONGO_DB; + + /* + * Describes a connection to a MongoDB data source + */ + private MongoDbConnectionInfo input; + + /* + * An array containing a single MongoDbClusterInfo object + */ + private List output; + + /** + * Creates an instance of ConnectToMongoDbTaskProperties class. + */ + public ConnectToMongoDbTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToMongoDbTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToMongoDbTaskProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectToMongoDbTaskProperties. + */ + public static ConnectToMongoDbTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectToMongoDbTaskProperties deserializedConnectToMongoDbTaskProperties + = new ConnectToMongoDbTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedConnectToMongoDbTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedConnectToMongoDbTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedConnectToMongoDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToMongoDbTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedConnectToMongoDbTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedConnectToMongoDbTaskProperties.input = MongoDbConnectionInfo.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output = reader.readArray(reader1 -> MongoDbClusterInfo.fromJson(reader1)); + deserializedConnectToMongoDbTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToMongoDbTaskProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java index f97ee57501c8..6d9ac17e81c0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java @@ -32,6 +32,11 @@ public final class ConnectToSourceMySqlTaskInput implements JsonSerializable output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToSourceMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -128,10 +140,14 @@ public static ConnectToSourceMySqlTaskProperties fromJson(JsonReader jsonReader) } else if ("state".equals(fieldName)) { deserializedConnectToSourceMySqlTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToSourceMySqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToSourceMySqlTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToSourceMySqlTaskProperties.taskType = reader.getString(); + deserializedConnectToSourceMySqlTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToSourceMySqlTaskProperties.input = ConnectToSourceMySqlTaskInput.fromJson(reader); 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 72d9c576dd44..a9d2b2a5caa8 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 @@ -13,7 +13,7 @@ import java.util.List; /** - * Output for connect to Oracle, MySQL type source. + * Output for connect to MySQL type source. */ @Immutable public final class ConnectToSourceNonSqlTaskOutput implements JsonSerializable { 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 000000000000..246e6cb97f98 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for the task that validates Oracle database connection. + */ +@Fluent +public final class ConnectToSourceOracleSyncTaskInput implements JsonSerializable { + /* + * Information for connecting to Oracle source + */ + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Creates an instance of ConnectToSourceOracleSyncTaskInput class. + */ + public ConnectToSourceOracleSyncTaskInput() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToSourceOracleSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectToSourceOracleSyncTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToSourceOracleSyncTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToSourceOracleSyncTaskInput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectToSourceOracleSyncTaskInput. + */ + public static ConnectToSourceOracleSyncTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectToSourceOracleSyncTaskInput deserializedConnectToSourceOracleSyncTaskInput + = new ConnectToSourceOracleSyncTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceConnectionInfo".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskInput.sourceConnectionInfo + = OracleConnectionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToSourceOracleSyncTaskInput; + }); + } +} 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 000000000000..f59ed1d8222e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Output for the task that validates Oracle database connection. + */ +@Immutable +public final class ConnectToSourceOracleSyncTaskOutput + implements JsonSerializable { + /* + * Version of the source server + */ + private String sourceServerVersion; + + /* + * List of schemas on source server + */ + private List databases; + + /* + * Source server brand version + */ + private String sourceServerBrandVersion; + + /* + * Validation errors associated with the task + */ + private List validationErrors; + + /** + * Creates an instance of ConnectToSourceOracleSyncTaskOutput class. + */ + public ConnectToSourceOracleSyncTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToSourceOracleSyncTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToSourceOracleSyncTaskOutput if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectToSourceOracleSyncTaskOutput. + */ + public static ConnectToSourceOracleSyncTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectToSourceOracleSyncTaskOutput deserializedConnectToSourceOracleSyncTaskOutput + = new ConnectToSourceOracleSyncTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceServerVersion".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskOutput.sourceServerVersion = reader.getString(); + } else if ("databases".equals(fieldName)) { + List databases = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectToSourceOracleSyncTaskOutput.databases = databases; + } else if ("sourceServerBrandVersion".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskOutput.sourceServerBrandVersion = reader.getString(); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedConnectToSourceOracleSyncTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToSourceOracleSyncTaskOutput; + }); + } +} 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 000000000000..da357384c470 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates Oracle database connection. + */ +@Fluent +public final class ConnectToSourceOracleSyncTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.CONNECT_TO_SOURCE_ORACLE_SYNC; + + /* + * Task input + */ + private ConnectToSourceOracleSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of ConnectToSourceOracleSyncTaskProperties class. + */ + public ConnectToSourceOracleSyncTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToSourceOracleSyncTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToSourceOracleSyncTaskProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectToSourceOracleSyncTaskProperties. + */ + public static ConnectToSourceOracleSyncTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectToSourceOracleSyncTaskProperties deserializedConnectToSourceOracleSyncTaskProperties + = new ConnectToSourceOracleSyncTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedConnectToSourceOracleSyncTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedConnectToSourceOracleSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToSourceOracleSyncTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedConnectToSourceOracleSyncTaskProperties.input + = ConnectToSourceOracleSyncTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> ConnectToSourceOracleSyncTaskOutput.fromJson(reader1)); + deserializedConnectToSourceOracleSyncTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToSourceOracleSyncTaskProperties; + }); + } +} 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 00fe582c4110..5495ed0c2726 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to PostgreSQL server and source server requirements for online @@ -21,7 +23,7 @@ public final class ConnectToSourcePostgreSqlSyncTaskProperties extends ProjectTa /* * Task type. */ - private String taskType = "ConnectToSource.PostgreSql.Sync"; + private TaskType taskType = TaskType.CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC; /* * Task input @@ -45,7 +47,7 @@ public ConnectToSourcePostgreSqlSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -78,6 +80,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToSourcePostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -102,7 +113,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -130,10 +142,15 @@ public static ConnectToSourcePostgreSqlSyncTaskProperties fromJson(JsonReader js deserializedConnectToSourcePostgreSqlSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToSourcePostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToSourcePostgreSqlSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToSourcePostgreSqlSyncTaskProperties.taskType = reader.getString(); + deserializedConnectToSourcePostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToSourcePostgreSqlSyncTaskProperties.input = ConnectToSourcePostgreSqlSyncTaskInput.fromJson(reader); 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 51d853742abb..01713ef85f17 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; 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. @@ -20,7 +22,7 @@ public final class ConnectToSourceSqlServerSyncTaskProperties extends ProjectTas /* * Task type. */ - private String taskType = "ConnectToSource.SqlServer.Sync"; + private TaskType taskType = TaskType.CONNECT_TO_SOURCE_SQL_SERVER_SYNC; /* * Task input @@ -44,7 +46,7 @@ public ConnectToSourceSqlServerSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToSourceSqlServerSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static ConnectToSourceSqlServerSyncTaskProperties fromJson(JsonReader jso deserializedConnectToSourceSqlServerSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToSourceSqlServerSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToSourceSqlServerSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToSourceSqlServerSyncTaskProperties.taskType = reader.getString(); + deserializedConnectToSourceSqlServerSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToSourceSqlServerSyncTaskProperties.input = ConnectToSourceSqlServerTaskInput.fromJson(reader); 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 465ff1b7f571..e4de35d2c0c5 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 @@ -27,6 +27,11 @@ public final class ConnectToSourceSqlServerTaskInput implements JsonSerializable */ private ServerLevelPermissionsGroup checkPermissionsGroup; + /* + * Flag for whether to collect databases from source server. + */ + private Boolean collectDatabases; + /* * Flag for whether to collect logins from source server. */ @@ -37,6 +42,21 @@ public final class ConnectToSourceSqlServerTaskInput implements JsonSerializable */ private Boolean collectAgentJobs; + /* + * Flag for whether to collect TDE Certificate names from source server. + */ + private Boolean collectTdeCertificateInfo; + + /* + * Flag for whether to validate SSIS catalog is reachable on the source server. + */ + private Boolean validateSsisCatalogOnly; + + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + /** * Creates an instance of ConnectToSourceSqlServerTaskInput class. */ @@ -84,6 +104,26 @@ public ServerLevelPermissionsGroup checkPermissionsGroup() { 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. * @@ -124,6 +164,68 @@ public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAge return this; } + /** + * Get the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @return the collectTdeCertificateInfo value. + */ + public Boolean collectTdeCertificateInfo() { + return this.collectTdeCertificateInfo; + } + + /** + * Set the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @param collectTdeCertificateInfo the collectTdeCertificateInfo value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectTdeCertificateInfo(Boolean collectTdeCertificateInfo) { + this.collectTdeCertificateInfo = collectTdeCertificateInfo; + return this; + } + + /** + * Get the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @return the validateSsisCatalogOnly value. + */ + public Boolean validateSsisCatalogOnly() { + return this.validateSsisCatalogOnly; + } + + /** + * Set the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @param validateSsisCatalogOnly the validateSsisCatalogOnly value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withValidateSsisCatalogOnly(Boolean validateSsisCatalogOnly) { + this.validateSsisCatalogOnly = validateSsisCatalogOnly; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * Validates the instance. * @@ -150,8 +252,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); jsonWriter.writeStringField("checkPermissionsGroup", this.checkPermissionsGroup == null ? null : this.checkPermissionsGroup.toString()); + jsonWriter.writeBooleanField("collectDatabases", this.collectDatabases); jsonWriter.writeBooleanField("collectLogins", this.collectLogins); jsonWriter.writeBooleanField("collectAgentJobs", this.collectAgentJobs); + jsonWriter.writeBooleanField("collectTdeCertificateInfo", this.collectTdeCertificateInfo); + jsonWriter.writeBooleanField("validateSsisCatalogOnly", this.validateSsisCatalogOnly); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); return jsonWriter.writeEndObject(); } @@ -178,12 +284,23 @@ public static ConnectToSourceSqlServerTaskInput fromJson(JsonReader jsonReader) } else if ("checkPermissionsGroup".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskInput.checkPermissionsGroup = ServerLevelPermissionsGroup.fromString(reader.getString()); + } else if ("collectDatabases".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskInput.collectDatabases + = reader.getNullable(JsonReader::getBoolean); } else if ("collectLogins".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskInput.collectLogins = reader.getNullable(JsonReader::getBoolean); } else if ("collectAgentJobs".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskInput.collectAgentJobs = reader.getNullable(JsonReader::getBoolean); + } else if ("collectTdeCertificateInfo".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskInput.collectTdeCertificateInfo + = reader.getNullable(JsonReader::getBoolean); + } else if ("validateSsisCatalogOnly".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskInput.validateSsisCatalogOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskInput.encryptedKeyForSecureFields = reader.getString(); } else { reader.skipChildren(); } 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 26aad955e9fd..94e3ec4524d5 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.azure.json.JsonWriter; import java.io.IOException; 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. */ @Immutable @@ -24,30 +25,35 @@ public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends Conne private String resultType = "AgentJobLevelOutput"; /* - * AgentJob name + * Agent Job name */ private String name; /* - * The type of AgentJob. + * The type of Agent Job. */ private String jobCategory; /* - * The state of the original AgentJob. + * The state of the original Agent Job. */ private Boolean isEnabled; /* - * The owner of the AgentJob + * The owner of the Agent Job */ private String jobOwner; /* - * UTC Date and time when the AgentJob was last executed. + * UTC Date and time when the Agent Job was last executed. */ private OffsetDateTime lastExecutedOn; + /* + * Validation errors + */ + private List validationErrors; + /* * Information about eligibility of agent job for migration. */ @@ -70,7 +76,7 @@ public String resultType() { } /** - * Get the name property: AgentJob name. + * Get the name property: Agent Job name. * * @return the name value. */ @@ -79,7 +85,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. */ @@ -88,7 +94,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. */ @@ -97,7 +103,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. */ @@ -106,7 +112,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. */ @@ -114,6 +120,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. * @@ -130,6 +145,9 @@ public MigrationEligibilityInfo migrationEligibility() { */ @Override public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } if (migrationEligibility() != null) { migrationEligibility().validate(); } @@ -177,6 +195,10 @@ public static ConnectToSourceSqlServerTaskOutputAgentJobLevel fromJson(JsonReade } else if ("lastExecutedOn".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskOutputAgentJobLevel.lastExecutedOn = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedConnectToSourceSqlServerTaskOutputAgentJobLevel.validationErrors = validationErrors; } else if ("migrationEligibility".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskOutputAgentJobLevel.migrationEligibility = MigrationEligibilityInfo.fromJson(reader); 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 4b44b1993be1..686202a8c7ca 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 @@ -36,6 +36,11 @@ public final class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectTo */ private String agentJobs; + /* + * Mapping from database name to TDE certificate name, if applicable + */ + private String databaseTdeCertificateMapping; + /* * Source server version */ @@ -94,6 +99,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. * @@ -169,6 +184,9 @@ public static ConnectToSourceSqlServerTaskOutputTaskLevel fromJson(JsonReader js deserializedConnectToSourceSqlServerTaskOutputTaskLevel.logins = reader.getString(); } else if ("agentJobs".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskOutputTaskLevel.agentJobs = reader.getString(); + } else if ("databaseTdeCertificateMapping".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskOutputTaskLevel.databaseTdeCertificateMapping + = reader.getString(); } else if ("sourceServerVersion".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskOutputTaskLevel.sourceServerVersion = reader.getString(); } else if ("sourceServerBrandVersion".equals(fieldName)) { 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 ca52a3fbd4be..379df2d7b3ae 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to SQL Server and also validates source server requirements. @@ -20,7 +22,7 @@ public final class ConnectToSourceSqlServerTaskProperties extends ProjectTaskPro /* * Task type. */ - private String taskType = "ConnectToSource.SqlServer"; + private TaskType taskType = TaskType.CONNECT_TO_SOURCE_SQL_SERVER; /* * Task input @@ -32,6 +34,11 @@ public final class ConnectToSourceSqlServerTaskProperties extends ProjectTaskPro */ private List output; + /* + * Task id + */ + private String taskId; + /** * Creates an instance of ConnectToSourceSqlServerTaskProperties class. */ @@ -44,7 +51,7 @@ public ConnectToSourceSqlServerTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +84,35 @@ public List output() { return this.output; } + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectToSourceSqlServerTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +137,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("taskId", this.taskId); return jsonWriter.writeEndObject(); } @@ -129,10 +167,15 @@ public static ConnectToSourceSqlServerTaskProperties fromJson(JsonReader jsonRea deserializedConnectToSourceSqlServerTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToSourceSqlServerTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToSourceSqlServerTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToSourceSqlServerTaskProperties.taskType = reader.getString(); + deserializedConnectToSourceSqlServerTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToSourceSqlServerTaskProperties.input = ConnectToSourceSqlServerTaskInput.fromJson(reader); @@ -140,6 +183,8 @@ public static ConnectToSourceSqlServerTaskProperties fromJson(JsonReader jsonRea List output = reader.readArray(reader1 -> ConnectToSourceSqlServerTaskOutput.fromJson(reader1)); deserializedConnectToSourceSqlServerTaskProperties.output = output; + } else if ("taskId".equals(fieldName)) { + deserializedConnectToSourceSqlServerTaskProperties.taskId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java index 36179d0a72c5..206625c70307 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java @@ -28,6 +28,11 @@ public final class ConnectToTargetAzureDbForMySqlTaskInput */ private MySqlConnectionInfo targetConnectionInfo; + /* + * Flag for whether or not the migration is offline + */ + private Boolean isOfflineMigration; + /** * Creates an instance of ConnectToTargetAzureDbForMySqlTaskInput class. */ @@ -74,6 +79,26 @@ public ConnectToTargetAzureDbForMySqlTaskInput withTargetConnectionInfo(MySqlCon return this; } + /** + * Get the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @return the isOfflineMigration value. + */ + public Boolean isOfflineMigration() { + return this.isOfflineMigration; + } + + /** + * Set the isOfflineMigration property: Flag for whether or not the migration is offline. + * + * @param isOfflineMigration the isOfflineMigration value to set. + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withIsOfflineMigration(Boolean isOfflineMigration) { + this.isOfflineMigration = isOfflineMigration; + return this; + } + /** * Validates the instance. * @@ -106,6 +131,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); jsonWriter.writeJsonField("targetConnectionInfo", this.targetConnectionInfo); + jsonWriter.writeBooleanField("isOfflineMigration", this.isOfflineMigration); return jsonWriter.writeEndObject(); } @@ -132,6 +158,9 @@ public static ConnectToTargetAzureDbForMySqlTaskInput fromJson(JsonReader jsonRe } else if ("targetConnectionInfo".equals(fieldName)) { deserializedConnectToTargetAzureDbForMySqlTaskInput.targetConnectionInfo = MySqlConnectionInfo.fromJson(reader); + } else if ("isOfflineMigration".equals(fieldName)) { + deserializedConnectToTargetAzureDbForMySqlTaskInput.isOfflineMigration + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } 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 9c65ea6dc924..6ceab2ddcb5f 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to Azure Database for MySQL and target server requirements. @@ -20,7 +22,7 @@ public final class ConnectToTargetAzureDbForMySqlTaskProperties extends ProjectT /* * Task type. */ - private String taskType = "ConnectToTarget.AzureDbForMySql"; + private TaskType taskType = TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL; /* * Task input @@ -44,7 +46,7 @@ public ConnectToTargetAzureDbForMySqlTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetAzureDbForMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static ConnectToTargetAzureDbForMySqlTaskProperties fromJson(JsonReader j deserializedConnectToTargetAzureDbForMySqlTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetAzureDbForMySqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetAzureDbForMySqlTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetAzureDbForMySqlTaskProperties.taskType = reader.getString(); + deserializedConnectToTargetAzureDbForMySqlTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetAzureDbForMySqlTaskProperties.input = ConnectToTargetAzureDbForMySqlTaskInput.fromJson(reader); 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 31bd1e41fa13..3ef940a35244 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to Azure Database For PostgreSQL server and target server @@ -21,7 +23,7 @@ public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties extends /* * Task type. */ - private String taskType = "ConnectToTarget.AzureDbForPostgreSql.Sync"; + private TaskType taskType = TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC; /* * Task input @@ -45,7 +47,7 @@ public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -79,6 +81,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -103,7 +114,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -132,10 +144,15 @@ public static ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties fromJson(Jso deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.taskType = reader.getString(); + deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.input = ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.fromJson(reader); 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 000000000000..6eabe918b558 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + implements JsonSerializable { + /* + * Connection information for target Azure Database for PostgreSQL server + */ + private PostgreSqlConnectionInfo targetConnectionInfo; + + /** + * Creates an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput class. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetConnectionInfo in model ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("targetConnectionInfo", this.targetConnectionInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput. + */ + public static ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + = new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetConnectionInfo".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.targetConnectionInfo + = PostgreSqlConnectionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput; + }); + } +} 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 000000000000..f7a19f1a1a7e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * Version of the target server + */ + private String targetServerVersion; + + /* + * List of databases on target server + */ + private List databases; + + /* + * Target server brand version + */ + private String targetServerBrandVersion; + + /* + * Validation errors associated with the task + */ + private List validationErrors; + + /* + * Mapping of schemas per database + */ + private List databaseSchemaMap; + + /** + * Creates an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput class. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("databaseSchemaMap", this.databaseSchemaMap, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput. + */ + public static ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + = new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetServerVersion".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.targetServerVersion + = reader.getString(); + } else if ("databases".equals(fieldName)) { + List databases = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.databases = databases; + } else if ("targetServerBrandVersion".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.targetServerBrandVersion + = reader.getString(); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.validationErrors + = validationErrors; + } else if ("databaseSchemaMap".equals(fieldName)) { + List databaseSchemaMap + = reader.readArray( + reader1 -> ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + .fromJson(reader1)); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.databaseSchemaMap + = databaseSchemaMap; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput; + }); + } +} 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 000000000000..7b0830a41885 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem model. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + implements JsonSerializable { + /* + * The database property. + */ + private String database; + + /* + * The schemas property. + */ + private List schemas; + + /** + * Creates an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem class. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("database", this.database); + jsonWriter.writeArrayField("schemas", this.schemas, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem. + */ + public static ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem + = new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("database".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.database + = reader.getString(); + } else if ("schemas".equals(fieldName)) { + List schemas = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.schemas + = schemas; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem; + }); + } +} 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 000000000000..b7f0d3555c3f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +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. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC; + + /* + * Task input + */ + private ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties class. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties. + */ + public static ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + = new ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.input + = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output = reader.readArray( + reader1 -> ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.fromJson(reader1)); + deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties; + }); + } +} 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 55089a02e855..aeab58af34f2 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; 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. @@ -20,7 +22,7 @@ public final class ConnectToTargetSqlDbSyncTaskProperties extends ProjectTaskPro /* * Task type. */ - private String taskType = "ConnectToTarget.SqlDb.Sync"; + private TaskType taskType = TaskType.CONNECT_TO_TARGET_SQL_DB_SYNC; /* * Task input @@ -44,7 +46,7 @@ public ConnectToTargetSqlDbSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static ConnectToTargetSqlDbSyncTaskProperties fromJson(JsonReader jsonRea deserializedConnectToTargetSqlDbSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetSqlDbSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetSqlDbSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetSqlDbSyncTaskProperties.taskType = reader.getString(); + deserializedConnectToTargetSqlDbSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetSqlDbSyncTaskProperties.input = ConnectToTargetSqlDbSyncTaskInput.fromJson(reader); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java index e07f1806a201..23a3ceef2d12 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java @@ -22,6 +22,11 @@ public final class ConnectToTargetSqlDbTaskInput implements JsonSerializable output; + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + /** * Creates an instance of ConnectToTargetSqlDbTaskProperties class. */ @@ -44,7 +51,7 @@ public ConnectToTargetSqlDbTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +84,35 @@ public List output() { return this.output; } + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +137,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("createdOn", this.createdOn); return jsonWriter.writeEndObject(); } @@ -128,10 +166,14 @@ public static ConnectToTargetSqlDbTaskProperties fromJson(JsonReader jsonReader) } else if ("state".equals(fieldName)) { deserializedConnectToTargetSqlDbTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetSqlDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetSqlDbTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetSqlDbTaskProperties.taskType = reader.getString(); + deserializedConnectToTargetSqlDbTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetSqlDbTaskProperties.input = ConnectToTargetSqlDbTaskInput.fromJson(reader); @@ -139,6 +181,8 @@ public static ConnectToTargetSqlDbTaskProperties fromJson(JsonReader jsonReader) List output = reader.readArray(reader1 -> ConnectToTargetSqlDbTaskOutput.fromJson(reader1)); deserializedConnectToTargetSqlDbTaskProperties.output = output; + } else if ("createdOn".equals(fieldName)) { + deserializedConnectToTargetSqlDbTaskProperties.createdOn = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java index fad4764db536..0ebc81b92aa8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java @@ -23,8 +23,8 @@ public final class ConnectToTargetSqlMISyncTaskInput implements JsonSerializable private MiSqlConnectionInfo targetConnectionInfo; /* - * Azure Active Directory Application the DMS instance will use to connect to the target instance of Azure SQL - * Database Managed Instance and the Azure Storage Account + * Azure Active Directory Application the DMS (classic) instance will use to connect to the target instance of Azure + * SQL Database Managed Instance and the Azure Storage Account */ private AzureActiveDirectoryApp azureApp; @@ -55,8 +55,8 @@ public ConnectToTargetSqlMISyncTaskInput withTargetConnectionInfo(MiSqlConnectio } /** - * Get the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target - * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * Get the azureApp property: Azure Active Directory Application the DMS (classic) instance will use to connect to + * the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. * * @return the azureApp value. */ @@ -65,8 +65,8 @@ public AzureActiveDirectoryApp azureApp() { } /** - * Set the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target - * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * Set the azureApp property: Azure Active Directory Application the DMS (classic) instance will use to connect to + * the target instance of Azure SQL Database Managed Instance and the Azure Storage Account. * * @param azureApp the azureApp value to set. * @return the ConnectToTargetSqlMISyncTaskInput object itself. 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 f80dda0b81e7..1214f7e15f59 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that validates connection to Azure SQL Database Managed Instance. @@ -20,7 +22,7 @@ public final class ConnectToTargetSqlMISyncTaskProperties extends ProjectTaskPro /* * Task type. */ - private String taskType = "ConnectToTarget.AzureSqlDbMI.Sync.LRS"; + private TaskType taskType = TaskType.CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS; /* * Task input @@ -44,7 +46,7 @@ public ConnectToTargetSqlMISyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static ConnectToTargetSqlMISyncTaskProperties fromJson(JsonReader jsonRea deserializedConnectToTargetSqlMISyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetSqlMISyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetSqlMISyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetSqlMISyncTaskProperties.taskType = reader.getString(); + deserializedConnectToTargetSqlMISyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetSqlMISyncTaskProperties.input = ConnectToTargetSqlMISyncTaskInput.fromJson(reader); 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 235cd8d530c3..b91a10e739f1 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 @@ -22,6 +22,21 @@ public final class ConnectToTargetSqlMITaskInput implements JsonSerializable output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ConnectToTargetSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -128,10 +140,14 @@ public static ConnectToTargetSqlMITaskProperties fromJson(JsonReader jsonReader) } else if ("state".equals(fieldName)) { deserializedConnectToTargetSqlMITaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedConnectToTargetSqlMITaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectToTargetSqlMITaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedConnectToTargetSqlMITaskProperties.taskType = reader.getString(); + deserializedConnectToTargetSqlMITaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedConnectToTargetSqlMITaskProperties.input = ConnectToTargetSqlMITaskInput.fromJson(reader); 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 584cb7e38127..3cb2ef5fd665 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 @@ -130,10 +130,14 @@ public static ConnectionInfo fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("SqlConnectionInfo".equals(discriminatorValue)) { + if ("MongoDbConnectionInfo".equals(discriminatorValue)) { + return MongoDbConnectionInfo.fromJson(readerToUse.reset()); + } else if ("SqlConnectionInfo".equals(discriminatorValue)) { return SqlConnectionInfo.fromJson(readerToUse.reset()); } else if ("MySqlConnectionInfo".equals(discriminatorValue)) { return MySqlConnectionInfo.fromJson(readerToUse.reset()); + } else if ("OracleConnectionInfo".equals(discriminatorValue)) { + return OracleConnectionInfo.fromJson(readerToUse.reset()); } else if ("PostgreSqlConnectionInfo".equals(discriminatorValue)) { return PostgreSqlConnectionInfo.fromJson(readerToUse.reset()); } else if ("MiSqlConnectionInfo".equals(discriminatorValue)) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java new file mode 100644 index 000000000000..876c6ca2b6ad --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CopyProgressDetails.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Details on progress of ADF copy activity. + */ +@Immutable +public final class CopyProgressDetails implements JsonSerializable { + /* + * Table Name + */ + private String tableName; + + /* + * Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + */ + private String status; + + /* + * Type of parallel copy (Dynamic range, Physical partition, none). + */ + private String parallelCopyType; + + /* + * The degree of parallelization. + */ + private Integer usedParallelCopies; + + /* + * Bytes read + */ + private Long dataRead; + + /* + * Bytes written + */ + private Long dataWritten; + + /* + * Rows read + */ + private Long rowsRead; + + /* + * Rows Copied + */ + private Long rowsCopied; + + /* + * Copy Start + */ + private OffsetDateTime copyStart; + + /* + * Copy throughput in KBps + */ + private Double copyThroughput; + + /* + * Copy Duration in seconds + */ + private Integer copyDuration; + + /** + * Creates an instance of CopyProgressDetails class. + */ + public CopyProgressDetails() { + } + + /** + * Get the tableName property: Table Name. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the status property: Status of the Copy activity (InProgress, Succeeded, Failed, Canceled). + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the parallelCopyType property: Type of parallel copy (Dynamic range, Physical partition, none). + * + * @return the parallelCopyType value. + */ + public String parallelCopyType() { + return this.parallelCopyType; + } + + /** + * Get the usedParallelCopies property: The degree of parallelization. + * + * @return the usedParallelCopies value. + */ + public Integer usedParallelCopies() { + return this.usedParallelCopies; + } + + /** + * Get the dataRead property: Bytes read. + * + * @return the dataRead value. + */ + public Long dataRead() { + return this.dataRead; + } + + /** + * Get the dataWritten property: Bytes written. + * + * @return the dataWritten value. + */ + public Long dataWritten() { + return this.dataWritten; + } + + /** + * Get the rowsRead property: Rows read. + * + * @return the rowsRead value. + */ + public Long rowsRead() { + return this.rowsRead; + } + + /** + * Get the rowsCopied property: Rows Copied. + * + * @return the rowsCopied value. + */ + public Long rowsCopied() { + return this.rowsCopied; + } + + /** + * Get the copyStart property: Copy Start. + * + * @return the copyStart value. + */ + public OffsetDateTime copyStart() { + return this.copyStart; + } + + /** + * Get the copyThroughput property: Copy throughput in KBps. + * + * @return the copyThroughput value. + */ + public Double copyThroughput() { + return this.copyThroughput; + } + + /** + * Get the copyDuration property: Copy Duration in seconds. + * + * @return the copyDuration value. + */ + public Integer copyDuration() { + return this.copyDuration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyProgressDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyProgressDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CopyProgressDetails. + */ + public static CopyProgressDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyProgressDetails deserializedCopyProgressDetails = new CopyProgressDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedCopyProgressDetails.tableName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCopyProgressDetails.status = reader.getString(); + } else if ("parallelCopyType".equals(fieldName)) { + deserializedCopyProgressDetails.parallelCopyType = reader.getString(); + } else if ("usedParallelCopies".equals(fieldName)) { + deserializedCopyProgressDetails.usedParallelCopies = reader.getNullable(JsonReader::getInt); + } else if ("dataRead".equals(fieldName)) { + deserializedCopyProgressDetails.dataRead = reader.getNullable(JsonReader::getLong); + } else if ("dataWritten".equals(fieldName)) { + deserializedCopyProgressDetails.dataWritten = reader.getNullable(JsonReader::getLong); + } else if ("rowsRead".equals(fieldName)) { + deserializedCopyProgressDetails.rowsRead = reader.getNullable(JsonReader::getLong); + } else if ("rowsCopied".equals(fieldName)) { + deserializedCopyProgressDetails.rowsCopied = reader.getNullable(JsonReader::getLong); + } else if ("copyStart".equals(fieldName)) { + deserializedCopyProgressDetails.copyStart = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("copyThroughput".equals(fieldName)) { + deserializedCopyProgressDetails.copyThroughput = reader.getNullable(JsonReader::getDouble); + } else if ("copyDuration".equals(fieldName)) { + deserializedCopyProgressDetails.copyDuration = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyProgressDetails; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CreatedByType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CreatedByType.java new file mode 100644 index 000000000000..b633b58a28ca --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CreatedByType.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 java.util.Collection; + +/** + * The type of identity that created the resource. + */ +public final class CreatedByType extends ExpandableStringEnum { + /** + * Static value User for CreatedByType. + */ + public static final CreatedByType USER = fromString("User"); + + /** + * Static value Application for CreatedByType. + */ + public static final CreatedByType APPLICATION = fromString("Application"); + + /** + * Static value ManagedIdentity for CreatedByType. + */ + public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Static value Key for CreatedByType. + */ + public static final CreatedByType KEY = fromString("Key"); + + /** + * Creates a new instance of CreatedByType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CreatedByType() { + } + + /** + * Creates or finds a CreatedByType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreatedByType. + */ + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** + * Gets known CreatedByType values. + * + * @return known CreatedByType values. + */ + public static Collection values() { + return values(CreatedByType.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 4bf25f17336d..c50c6eff5600 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Results for checksum based Data Integrity validation results. */ -@Immutable +@Fluent public final class DataIntegrityValidationResult implements JsonSerializable { /* * List of failed table names of source and target pair @@ -42,6 +42,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. * @@ -51,6 +62,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. * @@ -68,6 +90,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeMapField("failedObjects", this.failedObjects, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("validationErrors", this.validationErrors); return jsonWriter.writeEndObject(); } 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 f3e5d4fa90a2..77dda4be7a8a 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 @@ -70,6 +70,13 @@ public interface DataMigrationService { */ ServiceSku sku(); + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + /** * Gets the provisioningState property: The resource's provisioning state. * @@ -92,6 +99,29 @@ public interface DataMigrationService { */ String virtualSubnetId(); + /** + * Gets the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service + * have. + * + * @return the virtualNicId value. + */ + String virtualNicId(); + + /** + * Gets the autoStopDelay property: The time delay before the service is auto-stopped when idle. + * + * @return the autoStopDelay value. + */ + String autoStopDelay(); + + /** + * Gets the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. (Turned on by + * default). + * + * @return the deleteResourcesOnStop value. + */ + Boolean deleteResourcesOnStop(); + /** * Gets the region of the resource. * @@ -176,7 +206,9 @@ interface WithResourceGroup { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithEtag, DefinitionStages.WithKind, - DefinitionStages.WithSku, DefinitionStages.WithPublicKey, DefinitionStages.WithVirtualSubnetId { + DefinitionStages.WithSku, DefinitionStages.WithPublicKey, DefinitionStages.WithVirtualSubnetId, + DefinitionStages.WithVirtualNicId, DefinitionStages.WithAutoStopDelay, + DefinitionStages.WithDeleteResourcesOnStop { /** * Executes the create request. * @@ -273,6 +305,48 @@ interface WithVirtualSubnetId { */ WithCreate withVirtualSubnetId(String virtualSubnetId); } + + /** + * The stage of the DataMigrationService definition allowing to specify virtualNicId. + */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + WithCreate withVirtualNicId(String virtualNicId); + } + + /** + * The stage of the DataMigrationService definition allowing to specify autoStopDelay. + */ + interface WithAutoStopDelay { + /** + * Specifies the autoStopDelay property: The time delay before the service is auto-stopped when idle.. + * + * @param autoStopDelay The time delay before the service is auto-stopped when idle. + * @return the next definition stage. + */ + WithCreate withAutoStopDelay(String autoStopDelay); + } + + /** + * The stage of the DataMigrationService definition allowing to specify deleteResourcesOnStop. + */ + interface WithDeleteResourcesOnStop { + /** + * Specifies the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. + * (Turned on by default). + * + * @param deleteResourcesOnStop Whether service resources should be deleted when stopped. (Turned on by + * default). + * @return the next definition stage. + */ + WithCreate withDeleteResourcesOnStop(Boolean deleteResourcesOnStop); + } } /** @@ -286,7 +360,8 @@ interface WithVirtualSubnetId { * The template for DataMigrationService update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithEtag, UpdateStages.WithKind, UpdateStages.WithSku, - UpdateStages.WithPublicKey, UpdateStages.WithVirtualSubnetId { + UpdateStages.WithPublicKey, UpdateStages.WithVirtualSubnetId, UpdateStages.WithVirtualNicId, + UpdateStages.WithAutoStopDelay, UpdateStages.WithDeleteResourcesOnStop { /** * Executes the update request. * @@ -387,6 +462,48 @@ interface WithVirtualSubnetId { */ Update withVirtualSubnetId(String virtualSubnetId); } + + /** + * The stage of the DataMigrationService update allowing to specify virtualNicId. + */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + Update withVirtualNicId(String virtualNicId); + } + + /** + * The stage of the DataMigrationService update allowing to specify autoStopDelay. + */ + interface WithAutoStopDelay { + /** + * Specifies the autoStopDelay property: The time delay before the service is auto-stopped when idle.. + * + * @param autoStopDelay The time delay before the service is auto-stopped when idle. + * @return the next definition stage. + */ + Update withAutoStopDelay(String autoStopDelay); + } + + /** + * The stage of the DataMigrationService update allowing to specify deleteResourcesOnStop. + */ + interface WithDeleteResourcesOnStop { + /** + * Specifies the deleteResourcesOnStop property: Whether service resources should be deleted when stopped. + * (Turned on by default). + * + * @param deleteResourcesOnStop Whether service resources should be deleted when stopped. (Turned on by + * default). + * @return the next definition stage. + */ + Update withDeleteResourcesOnStop(Boolean deleteResourcesOnStop); + } } /** @@ -407,8 +524,8 @@ interface WithVirtualSubnetId { /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -421,8 +538,8 @@ interface WithVirtualSubnetId { /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -433,8 +550,8 @@ interface WithVirtualSubnetId { /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -444,8 +561,8 @@ interface WithVirtualSubnetId { /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -457,9 +574,9 @@ interface WithVirtualSubnetId { /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -469,9 +586,9 @@ interface WithVirtualSubnetId { /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -492,7 +609,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 along with {@link Response}. */ - Response nestedCheckNameAvailabilityWithResponse(NameAvailabilityRequest parameters, + Response checkChildrenNameAvailabilityWithResponse(NameAvailabilityRequest parameters, Context context); /** @@ -506,5 +623,5 @@ Response nestedCheckNameAvailabilityWithResponse(NameA * @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); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java index b45dae09168d..e7a4fa920614 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java @@ -18,6 +18,13 @@ public interface DataMigrationServiceStatusResponse { */ String agentVersion(); + /** + * Gets the agentConfiguration property: Agent Configuration. + * + * @return the agentConfiguration value. + */ + Object agentConfiguration(); + /** * Gets the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java new file mode 100644 index 000000000000..a470efaef5b0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; + +/** + * An immutable client-side representation of DatabaseMigration. + */ +public interface DatabaseMigration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Database Migration Resource properties. + * + * @return the properties value. + */ + DatabaseMigrationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner object. + * + * @return the inner object. + */ + DatabaseMigrationInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBase.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBase.java new file mode 100644 index 000000000000..c376a0324628 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBase.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; + +/** + * An immutable client-side representation of DatabaseMigrationBase. + */ +public interface DatabaseMigrationBase { + /** + * 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 properties property: Database Migration Base Resource properties. + * + * @return the properties value. + */ + DatabaseMigrationBaseProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner object. + * + * @return the inner object. + */ + DatabaseMigrationBaseInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseListResult.java new file mode 100644 index 000000000000..0111e627abdd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseListResult.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationBaseInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of Database Migrations. + */ +@Immutable +public final class DatabaseMigrationBaseListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of DatabaseMigrationBaseListResult class. + */ + public DatabaseMigrationBaseListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationBaseListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationBaseListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationBaseListResult. + */ + public static DatabaseMigrationBaseListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationBaseListResult deserializedDatabaseMigrationBaseListResult + = new DatabaseMigrationBaseListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DatabaseMigrationBaseInner.fromJson(reader1)); + deserializedDatabaseMigrationBaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseMigrationBaseListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationBaseListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseProperties.java new file mode 100644 index 000000000000..edb28aec63be --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationBaseProperties.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Database Migration Base Resource properties. + */ +@Fluent +public class DatabaseMigrationBaseProperties implements JsonSerializable { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.fromString("DatabaseMigrationBaseProperties"); + + /* + * Resource Id of the target resource. + */ + private String scope; + + /* + * Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and + * migration has started. + */ + private ProvisioningState provisioningState; + + /* + * Migration status. + */ + private String migrationStatus; + + /* + * Database migration start time. + */ + private OffsetDateTime startedOn; + + /* + * Database migration end time. + */ + private OffsetDateTime endedOn; + + /* + * Resource Id of the Migration Service. + */ + private String migrationService; + + /* + * ID for current migration operation. + */ + private String migrationOperationId; + + /* + * Error details in case of migration failure. + */ + private ErrorInfo migrationFailureError; + + /* + * Error message for migration provisioning failure, if any. + */ + private String provisioningError; + + /** + * Creates an instance of DatabaseMigrationBaseProperties class. + */ + public DatabaseMigrationBaseProperties() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + public ResourceType kind() { + return this.kind; + } + + /** + * Get the scope property: Resource Id of the target resource. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: Resource Id of the target resource. + * + * @param scope the scope value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + public DatabaseMigrationBaseProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the provisioningState property: Provisioning State of migration. ProvisioningState as Succeeded implies that + * validations have been performed and migration has started. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning State of migration. ProvisioningState as Succeeded implies that + * validations have been performed and migration has started. + * + * @param provisioningState the provisioningState value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + DatabaseMigrationBaseProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the migrationStatus property: Migration status. + * + * @return the migrationStatus value. + */ + public String migrationStatus() { + return this.migrationStatus; + } + + /** + * Set the migrationStatus property: Migration status. + * + * @param migrationStatus the migrationStatus value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + DatabaseMigrationBaseProperties withMigrationStatus(String migrationStatus) { + this.migrationStatus = migrationStatus; + return this; + } + + /** + * Get the startedOn property: Database migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Database migration start time. + * + * @param startedOn the startedOn value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + DatabaseMigrationBaseProperties withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the endedOn property: Database migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Set the endedOn property: Database migration end time. + * + * @param endedOn the endedOn value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + DatabaseMigrationBaseProperties withEndedOn(OffsetDateTime endedOn) { + this.endedOn = endedOn; + return this; + } + + /** + * Get the migrationService property: Resource Id of the Migration Service. + * + * @return the migrationService value. + */ + public String migrationService() { + return this.migrationService; + } + + /** + * Set the migrationService property: Resource Id of the Migration Service. + * + * @param migrationService the migrationService value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + public DatabaseMigrationBaseProperties withMigrationService(String migrationService) { + this.migrationService = migrationService; + return this; + } + + /** + * Get the migrationOperationId property: ID for current migration operation. + * + * @return the migrationOperationId value. + */ + public String migrationOperationId() { + return this.migrationOperationId; + } + + /** + * Set the migrationOperationId property: ID for current migration operation. + * + * @param migrationOperationId the migrationOperationId value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + public DatabaseMigrationBaseProperties withMigrationOperationId(String migrationOperationId) { + this.migrationOperationId = migrationOperationId; + return this; + } + + /** + * Get the migrationFailureError property: Error details in case of migration failure. + * + * @return the migrationFailureError value. + */ + public ErrorInfo migrationFailureError() { + return this.migrationFailureError; + } + + /** + * Set the migrationFailureError property: Error details in case of migration failure. + * + * @param migrationFailureError the migrationFailureError value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + DatabaseMigrationBaseProperties withMigrationFailureError(ErrorInfo migrationFailureError) { + this.migrationFailureError = migrationFailureError; + return this; + } + + /** + * Get the provisioningError property: Error message for migration provisioning failure, if any. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Set the provisioningError property: Error message for migration provisioning failure, if any. + * + * @param provisioningError the provisioningError value to set. + * @return the DatabaseMigrationBaseProperties object itself. + */ + public DatabaseMigrationBaseProperties withProvisioningError(String provisioningError) { + this.provisioningError = provisioningError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("migrationService", this.migrationService); + jsonWriter.writeStringField("migrationOperationId", this.migrationOperationId); + jsonWriter.writeStringField("provisioningError", this.provisioningError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationBaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationBaseProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationBaseProperties. + */ + public static DatabaseMigrationBaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("MongoToCosmosDbMongo".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesCosmosDbMongo.fromJson(readerToUse.reset()); + } else if ("DatabaseMigrationProperties".equals(discriminatorValue)) { + return DatabaseMigrationProperties.fromJsonKnownDiscriminator(readerToUse.reset()); + } else if ("SqlDb".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlDb.fromJson(readerToUse.reset()); + } else if ("SqlMi".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlMi.fromJson(readerToUse.reset()); + } else if ("SqlVm".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlVm.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DatabaseMigrationBaseProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationBaseProperties deserializedDatabaseMigrationBaseProperties + = new DatabaseMigrationBaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.kind = ResourceType.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.scope = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.migrationStatus = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.migrationService = reader.getString(); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.migrationOperationId = reader.getString(); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.migrationFailureError = ErrorInfo.fromJson(reader); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationBaseProperties.provisioningError = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationBaseProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongo.java new file mode 100644 index 000000000000..ab2cb0b3315b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongo.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; + +/** + * An immutable client-side representation of DatabaseMigrationCosmosDbMongo. + */ +public interface DatabaseMigrationCosmosDbMongo { + /** + * 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 properties property: Database Migration Resource properties for CosmosDb for Mongo. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesCosmosDbMongo properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner object. + * + * @return the inner object. + */ + DatabaseMigrationCosmosDbMongoInner innerModel(); + + /** + * The entirety of the DatabaseMigrationCosmosDbMongo definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DatabaseMigrationCosmosDbMongo definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DatabaseMigrationCosmosDbMongo definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DatabaseMigrationCosmosDbMongo definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, targetResourceName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @return the next definition stage. + */ + WithCreate withExistingDatabaseAccount(String resourceGroupName, String targetResourceName); + } + + /** + * The stage of the DatabaseMigrationCosmosDbMongo definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationCosmosDbMongo create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationCosmosDbMongo create(Context context); + } + + /** + * The stage of the DatabaseMigrationCosmosDbMongo definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for CosmosDb for Mongo.. + * + * @param properties Database Migration Resource properties for CosmosDb for Mongo. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesCosmosDbMongo properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationCosmosDbMongo refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationCosmosDbMongo refresh(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongoListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongoListResult.java new file mode 100644 index 000000000000..3e34923fb628 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationCosmosDbMongoListResult.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of Database Migrations. + */ +@Immutable +public final class DatabaseMigrationCosmosDbMongoListResult + implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of DatabaseMigrationCosmosDbMongoListResult class. + */ + public DatabaseMigrationCosmosDbMongoListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationCosmosDbMongoListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationCosmosDbMongoListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationCosmosDbMongoListResult. + */ + public static DatabaseMigrationCosmosDbMongoListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationCosmosDbMongoListResult deserializedDatabaseMigrationCosmosDbMongoListResult + = new DatabaseMigrationCosmosDbMongoListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DatabaseMigrationCosmosDbMongoInner.fromJson(reader1)); + deserializedDatabaseMigrationCosmosDbMongoListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseMigrationCosmosDbMongoListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationCosmosDbMongoListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java new file mode 100644 index 000000000000..a3fd8fedc35f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of Database Migrations. + */ +@Immutable +public final class DatabaseMigrationListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of DatabaseMigrationListResult class. + */ + public DatabaseMigrationListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationListResult. + */ + public static DatabaseMigrationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationListResult deserializedDatabaseMigrationListResult = new DatabaseMigrationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DatabaseMigrationInner.fromJson(reader1)); + deserializedDatabaseMigrationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseMigrationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java new file mode 100644 index 000000000000..26df96e99d0f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationProperties.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Database Migration Resource properties. + */ +@Fluent +public class DatabaseMigrationProperties extends DatabaseMigrationBaseProperties { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.fromString("DatabaseMigrationProperties"); + + /* + * Source SQL Server connection details. + */ + private SqlConnectionInformation sourceSqlConnection; + + /* + * Name of the source database. + */ + private String sourceDatabaseName; + + /* + * Name of the source sql server. + */ + private String sourceServerName; + + /* + * Database collation to be used for the target database. + */ + private String targetDatabaseCollation; + + /** + * Creates an instance of DatabaseMigrationProperties class. + */ + public DatabaseMigrationProperties() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Override + public ResourceType kind() { + return this.kind; + } + + /** + * Get the sourceSqlConnection property: Source SQL Server connection details. + * + * @return the sourceSqlConnection value. + */ + public SqlConnectionInformation sourceSqlConnection() { + return this.sourceSqlConnection; + } + + /** + * Set the sourceSqlConnection property: Source SQL Server connection details. + * + * @param sourceSqlConnection the sourceSqlConnection value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + this.sourceSqlConnection = sourceSqlConnection; + return this; + } + + /** + * Get the sourceDatabaseName property: Name of the source database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set the sourceDatabaseName property: Name of the source database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + + /** + * Get the sourceServerName property: Name of the source sql server. + * + * @return the sourceServerName value. + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Set the sourceServerName property: Name of the source sql server. + * + * @param sourceServerName the sourceServerName value to set. + * @return the DatabaseMigrationProperties object itself. + */ + DatabaseMigrationProperties withSourceServerName(String sourceServerName) { + this.sourceServerName = sourceServerName; + return this; + } + + /** + * Get the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @return the targetDatabaseCollation value. + */ + public String targetDatabaseCollation() { + return this.targetDatabaseCollation; + } + + /** + * Set the targetDatabaseCollation property: Database collation to be used for the target database. + * + * @param targetDatabaseCollation the targetDatabaseCollation value to set. + * @return the DatabaseMigrationProperties object itself. + */ + public DatabaseMigrationProperties withTargetDatabaseCollation(String targetDatabaseCollation) { + this.targetDatabaseCollation = targetDatabaseCollation; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationProperties withScope(String scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationProperties withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationProperties withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationProperties withProvisioningError(String provisioningError) { + super.withProvisioningError(provisioningError); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceSqlConnection() != null) { + sourceSqlConnection().validate(); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", scope()); + jsonWriter.writeStringField("migrationService", migrationService()); + jsonWriter.writeStringField("migrationOperationId", migrationOperationId()); + jsonWriter.writeStringField("provisioningError", provisioningError()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("sourceSqlConnection", this.sourceSqlConnection); + jsonWriter.writeStringField("sourceDatabaseName", this.sourceDatabaseName); + jsonWriter.writeStringField("targetDatabaseCollation", this.targetDatabaseCollation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationProperties. + */ + public static DatabaseMigrationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SqlDb".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlDb.fromJson(readerToUse.reset()); + } else if ("SqlMi".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlMi.fromJson(readerToUse.reset()); + } else if ("SqlVm".equals(discriminatorValue)) { + return DatabaseMigrationPropertiesSqlVm.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DatabaseMigrationProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationProperties deserializedDatabaseMigrationProperties = new DatabaseMigrationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withScope(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationProperties + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withMigrationStatus(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withStartedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withEndedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withMigrationService(reader.getString()); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withMigrationOperationId(reader.getString()); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withMigrationFailureError(ErrorInfo.fromJson(reader)); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationProperties.withProvisioningError(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationProperties.kind = ResourceType.fromString(reader.getString()); + } else if ("sourceSqlConnection".equals(fieldName)) { + deserializedDatabaseMigrationProperties.sourceSqlConnection + = SqlConnectionInformation.fromJson(reader); + } else if ("sourceDatabaseName".equals(fieldName)) { + deserializedDatabaseMigrationProperties.sourceDatabaseName = reader.getString(); + } else if ("sourceServerName".equals(fieldName)) { + deserializedDatabaseMigrationProperties.sourceServerName = reader.getString(); + } else if ("targetDatabaseCollation".equals(fieldName)) { + deserializedDatabaseMigrationProperties.targetDatabaseCollation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesCosmosDbMongo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesCosmosDbMongo.java new file mode 100644 index 000000000000..96dfb38dd898 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesCosmosDbMongo.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Database Migration Resource properties for CosmosDb for Mongo. + */ +@Fluent +public final class DatabaseMigrationPropertiesCosmosDbMongo extends DatabaseMigrationBaseProperties { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.MONGO_TO_COSMOS_DB_MONGO; + + /* + * Source Mongo connection details. + */ + private MongoConnectionInformation sourceMongoConnection; + + /* + * Target Cosmos DB Mongo connection details. + */ + private MongoConnectionInformation targetMongoConnection; + + /* + * List of Mongo Collections to be migrated. + */ + private List collectionList; + + /** + * Creates an instance of DatabaseMigrationPropertiesCosmosDbMongo class. + */ + public DatabaseMigrationPropertiesCosmosDbMongo() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Override + public ResourceType kind() { + return this.kind; + } + + /** + * Get the sourceMongoConnection property: Source Mongo connection details. + * + * @return the sourceMongoConnection value. + */ + public MongoConnectionInformation sourceMongoConnection() { + return this.sourceMongoConnection; + } + + /** + * Set the sourceMongoConnection property: Source Mongo connection details. + * + * @param sourceMongoConnection the sourceMongoConnection value to set. + * @return the DatabaseMigrationPropertiesCosmosDbMongo object itself. + */ + public DatabaseMigrationPropertiesCosmosDbMongo + withSourceMongoConnection(MongoConnectionInformation sourceMongoConnection) { + this.sourceMongoConnection = sourceMongoConnection; + return this; + } + + /** + * Get the targetMongoConnection property: Target Cosmos DB Mongo connection details. + * + * @return the targetMongoConnection value. + */ + public MongoConnectionInformation targetMongoConnection() { + return this.targetMongoConnection; + } + + /** + * Set the targetMongoConnection property: Target Cosmos DB Mongo connection details. + * + * @param targetMongoConnection the targetMongoConnection value to set. + * @return the DatabaseMigrationPropertiesCosmosDbMongo object itself. + */ + public DatabaseMigrationPropertiesCosmosDbMongo + withTargetMongoConnection(MongoConnectionInformation targetMongoConnection) { + this.targetMongoConnection = targetMongoConnection; + return this; + } + + /** + * Get the collectionList property: List of Mongo Collections to be migrated. + * + * @return the collectionList value. + */ + public List collectionList() { + return this.collectionList; + } + + /** + * Set the collectionList property: List of Mongo Collections to be migrated. + * + * @param collectionList the collectionList value to set. + * @return the DatabaseMigrationPropertiesCosmosDbMongo object itself. + */ + public DatabaseMigrationPropertiesCosmosDbMongo withCollectionList(List collectionList) { + this.collectionList = collectionList; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesCosmosDbMongo withScope(String scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesCosmosDbMongo withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesCosmosDbMongo withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesCosmosDbMongo withProvisioningError(String provisioningError) { + super.withProvisioningError(provisioningError); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceMongoConnection() != null) { + sourceMongoConnection().validate(); + } + if (targetMongoConnection() != null) { + targetMongoConnection().validate(); + } + if (collectionList() != null) { + collectionList().forEach(e -> e.validate()); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", scope()); + jsonWriter.writeStringField("migrationService", migrationService()); + jsonWriter.writeStringField("migrationOperationId", migrationOperationId()); + jsonWriter.writeStringField("provisioningError", provisioningError()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("sourceMongoConnection", this.sourceMongoConnection); + jsonWriter.writeJsonField("targetMongoConnection", this.targetMongoConnection); + jsonWriter.writeArrayField("collectionList", this.collectionList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationPropertiesCosmosDbMongo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationPropertiesCosmosDbMongo if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationPropertiesCosmosDbMongo. + */ + public static DatabaseMigrationPropertiesCosmosDbMongo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationPropertiesCosmosDbMongo deserializedDatabaseMigrationPropertiesCosmosDbMongo + = new DatabaseMigrationPropertiesCosmosDbMongo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withScope(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withMigrationStatus(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withStartedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withEndedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withMigrationService(reader.getString()); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withMigrationOperationId(reader.getString()); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo + .withMigrationFailureError(ErrorInfo.fromJson(reader)); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.withProvisioningError(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.kind + = ResourceType.fromString(reader.getString()); + } else if ("sourceMongoConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.sourceMongoConnection + = MongoConnectionInformation.fromJson(reader); + } else if ("targetMongoConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesCosmosDbMongo.targetMongoConnection + = MongoConnectionInformation.fromJson(reader); + } else if ("collectionList".equals(fieldName)) { + List collectionList + = reader.readArray(reader1 -> MongoMigrationCollection.fromJson(reader1)); + deserializedDatabaseMigrationPropertiesCosmosDbMongo.collectionList = collectionList; + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationPropertiesCosmosDbMongo; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java new file mode 100644 index 000000000000..9124d4115c4f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlDb.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Database Migration Resource properties for SQL database. + */ +@Fluent +public final class DatabaseMigrationPropertiesSqlDb extends DatabaseMigrationProperties { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.SQL_DB; + + /* + * Detailed migration status. Not included by default. + */ + private SqlDbMigrationStatusDetails migrationStatusDetails; + + /* + * Target SQL DB connection details. + */ + private SqlConnectionInformation targetSqlConnection; + + /* + * Offline configuration. + */ + private SqlDbOfflineConfiguration offlineConfiguration; + + /* + * List of tables to copy. + */ + private List tableList; + + /** + * Creates an instance of DatabaseMigrationPropertiesSqlDb class. + */ + public DatabaseMigrationPropertiesSqlDb() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Override + public ResourceType kind() { + return this.kind; + } + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public SqlDbMigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the targetSqlConnection property: Target SQL DB connection details. + * + * @return the targetSqlConnection value. + */ + public SqlConnectionInformation targetSqlConnection() { + return this.targetSqlConnection; + } + + /** + * Set the targetSqlConnection property: Target SQL DB connection details. + * + * @param targetSqlConnection the targetSqlConnection value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withTargetSqlConnection(SqlConnectionInformation targetSqlConnection) { + this.targetSqlConnection = targetSqlConnection; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public SqlDbOfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Get the tableList property: List of tables to copy. + * + * @return the tableList value. + */ + public List tableList() { + return this.tableList; + } + + /** + * Set the tableList property: List of tables to copy. + * + * @param tableList the tableList value to set. + * @return the DatabaseMigrationPropertiesSqlDb object itself. + */ + public DatabaseMigrationPropertiesSqlDb withTableList(List tableList) { + this.tableList = tableList; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withTargetDatabaseCollation(String targetDatabaseCollation) { + super.withTargetDatabaseCollation(targetDatabaseCollation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withScope(String scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlDb withProvisioningError(String provisioningError) { + super.withProvisioningError(provisioningError); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (targetSqlConnection() != null) { + targetSqlConnection().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + if (sourceSqlConnection() != null) { + sourceSqlConnection().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", scope()); + jsonWriter.writeStringField("migrationService", migrationService()); + jsonWriter.writeStringField("migrationOperationId", migrationOperationId()); + jsonWriter.writeStringField("provisioningError", provisioningError()); + jsonWriter.writeJsonField("sourceSqlConnection", sourceSqlConnection()); + jsonWriter.writeStringField("sourceDatabaseName", sourceDatabaseName()); + jsonWriter.writeStringField("targetDatabaseCollation", targetDatabaseCollation()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("targetSqlConnection", this.targetSqlConnection); + jsonWriter.writeArrayField("tableList", this.tableList, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationPropertiesSqlDb from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationPropertiesSqlDb if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationPropertiesSqlDb. + */ + public static DatabaseMigrationPropertiesSqlDb fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationPropertiesSqlDb deserializedDatabaseMigrationPropertiesSqlDb + = new DatabaseMigrationPropertiesSqlDb(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withScope(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withMigrationStatus(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withStartedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withEndedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withMigrationService(reader.getString()); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withMigrationOperationId(reader.getString()); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withMigrationFailureError(ErrorInfo.fromJson(reader)); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withProvisioningError(reader.getString()); + } else if ("sourceSqlConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb + .withSourceSqlConnection(SqlConnectionInformation.fromJson(reader)); + } else if ("sourceDatabaseName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withSourceDatabaseName(reader.getString()); + } else if ("sourceServerName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withSourceServerName(reader.getString()); + } else if ("targetDatabaseCollation".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.withTargetDatabaseCollation(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.kind = ResourceType.fromString(reader.getString()); + } else if ("migrationStatusDetails".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.migrationStatusDetails + = SqlDbMigrationStatusDetails.fromJson(reader); + } else if ("targetSqlConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.targetSqlConnection + = SqlConnectionInformation.fromJson(reader); + } else if ("offlineConfiguration".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlDb.offlineConfiguration + = SqlDbOfflineConfiguration.fromJson(reader); + } else if ("tableList".equals(fieldName)) { + List tableList = reader.readArray(reader1 -> reader1.getString()); + deserializedDatabaseMigrationPropertiesSqlDb.tableList = tableList; + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationPropertiesSqlDb; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java new file mode 100644 index 000000000000..da59507369b1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlMi.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Database Migration Resource properties for SQL Managed Instance. + */ +@Fluent +public final class DatabaseMigrationPropertiesSqlMi extends DatabaseMigrationProperties { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.SQL_MI; + + /* + * Detailed migration status. Not included by default. + */ + private MigrationStatusDetails migrationStatusDetails; + + /* + * Backup configuration info. + */ + private BackupConfiguration backupConfiguration; + + /* + * Offline configuration. + */ + private OfflineConfiguration offlineConfiguration; + + /** + * Creates an instance of DatabaseMigrationPropertiesSqlMi class. + */ + public DatabaseMigrationPropertiesSqlMi() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Override + public ResourceType kind() { + return this.kind; + } + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public MigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the backupConfiguration property: Backup configuration info. + * + * @return the backupConfiguration value. + */ + public BackupConfiguration backupConfiguration() { + return this.backupConfiguration; + } + + /** + * Set the backupConfiguration property: Backup configuration info. + * + * @param backupConfiguration the backupConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withBackupConfiguration(BackupConfiguration backupConfiguration) { + this.backupConfiguration = backupConfiguration; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public OfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Set the offlineConfiguration property: Offline configuration. + * + * @param offlineConfiguration the offlineConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlMi object itself. + */ + public DatabaseMigrationPropertiesSqlMi withOfflineConfiguration(OfflineConfiguration offlineConfiguration) { + this.offlineConfiguration = offlineConfiguration; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withTargetDatabaseCollation(String targetDatabaseCollation) { + super.withTargetDatabaseCollation(targetDatabaseCollation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withScope(String scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlMi withProvisioningError(String provisioningError) { + super.withProvisioningError(provisioningError); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (backupConfiguration() != null) { + backupConfiguration().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + if (sourceSqlConnection() != null) { + sourceSqlConnection().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", scope()); + jsonWriter.writeStringField("migrationService", migrationService()); + jsonWriter.writeStringField("migrationOperationId", migrationOperationId()); + jsonWriter.writeStringField("provisioningError", provisioningError()); + jsonWriter.writeJsonField("sourceSqlConnection", sourceSqlConnection()); + jsonWriter.writeStringField("sourceDatabaseName", sourceDatabaseName()); + jsonWriter.writeStringField("targetDatabaseCollation", targetDatabaseCollation()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("backupConfiguration", this.backupConfiguration); + jsonWriter.writeJsonField("offlineConfiguration", this.offlineConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationPropertiesSqlMi from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationPropertiesSqlMi if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationPropertiesSqlMi. + */ + public static DatabaseMigrationPropertiesSqlMi fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationPropertiesSqlMi deserializedDatabaseMigrationPropertiesSqlMi + = new DatabaseMigrationPropertiesSqlMi(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withScope(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withMigrationStatus(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withStartedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withEndedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withMigrationService(reader.getString()); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withMigrationOperationId(reader.getString()); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withMigrationFailureError(ErrorInfo.fromJson(reader)); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withProvisioningError(reader.getString()); + } else if ("sourceSqlConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi + .withSourceSqlConnection(SqlConnectionInformation.fromJson(reader)); + } else if ("sourceDatabaseName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withSourceDatabaseName(reader.getString()); + } else if ("sourceServerName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withSourceServerName(reader.getString()); + } else if ("targetDatabaseCollation".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.withTargetDatabaseCollation(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.kind = ResourceType.fromString(reader.getString()); + } else if ("migrationStatusDetails".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.migrationStatusDetails + = MigrationStatusDetails.fromJson(reader); + } else if ("backupConfiguration".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.backupConfiguration + = BackupConfiguration.fromJson(reader); + } else if ("offlineConfiguration".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlMi.offlineConfiguration + = OfflineConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationPropertiesSqlMi; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java new file mode 100644 index 000000000000..f7a80fd0c366 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationPropertiesSqlVm.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Database Migration Resource properties for SQL Virtual Machine. + */ +@Fluent +public final class DatabaseMigrationPropertiesSqlVm extends DatabaseMigrationProperties { + /* + * The kind property. + */ + private ResourceType kind = ResourceType.SQL_VM; + + /* + * Detailed migration status. Not included by default. + */ + private MigrationStatusDetails migrationStatusDetails; + + /* + * Backup configuration info. + */ + private BackupConfiguration backupConfiguration; + + /* + * Offline configuration. + */ + private OfflineConfiguration offlineConfiguration; + + /** + * Creates an instance of DatabaseMigrationPropertiesSqlVm class. + */ + public DatabaseMigrationPropertiesSqlVm() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Override + public ResourceType kind() { + return this.kind; + } + + /** + * Get the migrationStatusDetails property: Detailed migration status. Not included by default. + * + * @return the migrationStatusDetails value. + */ + public MigrationStatusDetails migrationStatusDetails() { + return this.migrationStatusDetails; + } + + /** + * Get the backupConfiguration property: Backup configuration info. + * + * @return the backupConfiguration value. + */ + public BackupConfiguration backupConfiguration() { + return this.backupConfiguration; + } + + /** + * Set the backupConfiguration property: Backup configuration info. + * + * @param backupConfiguration the backupConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withBackupConfiguration(BackupConfiguration backupConfiguration) { + this.backupConfiguration = backupConfiguration; + return this; + } + + /** + * Get the offlineConfiguration property: Offline configuration. + * + * @return the offlineConfiguration value. + */ + public OfflineConfiguration offlineConfiguration() { + return this.offlineConfiguration; + } + + /** + * Set the offlineConfiguration property: Offline configuration. + * + * @param offlineConfiguration the offlineConfiguration value to set. + * @return the DatabaseMigrationPropertiesSqlVm object itself. + */ + public DatabaseMigrationPropertiesSqlVm withOfflineConfiguration(OfflineConfiguration offlineConfiguration) { + this.offlineConfiguration = offlineConfiguration; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withSourceSqlConnection(SqlConnectionInformation sourceSqlConnection) { + super.withSourceSqlConnection(sourceSqlConnection); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withSourceDatabaseName(String sourceDatabaseName) { + super.withSourceDatabaseName(sourceDatabaseName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withTargetDatabaseCollation(String targetDatabaseCollation) { + super.withTargetDatabaseCollation(targetDatabaseCollation); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withScope(String scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withMigrationService(String migrationService) { + super.withMigrationService(migrationService); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withMigrationOperationId(String migrationOperationId) { + super.withMigrationOperationId(migrationOperationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DatabaseMigrationPropertiesSqlVm withProvisioningError(String provisioningError) { + super.withProvisioningError(provisioningError); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (migrationStatusDetails() != null) { + migrationStatusDetails().validate(); + } + if (backupConfiguration() != null) { + backupConfiguration().validate(); + } + if (offlineConfiguration() != null) { + offlineConfiguration().validate(); + } + if (migrationFailureError() != null) { + migrationFailureError().validate(); + } + if (sourceSqlConnection() != null) { + sourceSqlConnection().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", scope()); + jsonWriter.writeStringField("migrationService", migrationService()); + jsonWriter.writeStringField("migrationOperationId", migrationOperationId()); + jsonWriter.writeStringField("provisioningError", provisioningError()); + jsonWriter.writeJsonField("sourceSqlConnection", sourceSqlConnection()); + jsonWriter.writeStringField("sourceDatabaseName", sourceDatabaseName()); + jsonWriter.writeStringField("targetDatabaseCollation", targetDatabaseCollation()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("backupConfiguration", this.backupConfiguration); + jsonWriter.writeJsonField("offlineConfiguration", this.offlineConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseMigrationPropertiesSqlVm from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseMigrationPropertiesSqlVm if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseMigrationPropertiesSqlVm. + */ + public static DatabaseMigrationPropertiesSqlVm fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseMigrationPropertiesSqlVm deserializedDatabaseMigrationPropertiesSqlVm + = new DatabaseMigrationPropertiesSqlVm(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withScope(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm + .withProvisioningState(ProvisioningState.fromString(reader.getString())); + } else if ("migrationStatus".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withMigrationStatus(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withStartedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("endedOn".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withEndedOn(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("migrationService".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withMigrationService(reader.getString()); + } else if ("migrationOperationId".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withMigrationOperationId(reader.getString()); + } else if ("migrationFailureError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withMigrationFailureError(ErrorInfo.fromJson(reader)); + } else if ("provisioningError".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withProvisioningError(reader.getString()); + } else if ("sourceSqlConnection".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm + .withSourceSqlConnection(SqlConnectionInformation.fromJson(reader)); + } else if ("sourceDatabaseName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withSourceDatabaseName(reader.getString()); + } else if ("sourceServerName".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withSourceServerName(reader.getString()); + } else if ("targetDatabaseCollation".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.withTargetDatabaseCollation(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.kind = ResourceType.fromString(reader.getString()); + } else if ("migrationStatusDetails".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.migrationStatusDetails + = MigrationStatusDetails.fromJson(reader); + } else if ("backupConfiguration".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.backupConfiguration + = BackupConfiguration.fromJson(reader); + } else if ("offlineConfiguration".equals(fieldName)) { + deserializedDatabaseMigrationPropertiesSqlVm.offlineConfiguration + = OfflineConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseMigrationPropertiesSqlVm; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java new file mode 100644 index 000000000000..b92aa3ea1ab5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlDb.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights 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.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner; + +/** + * An immutable client-side representation of DatabaseMigrationSqlDb. + */ +public interface DatabaseMigrationSqlDb { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL database. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlDb properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlDbInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlDbInner innerModel(); + + /** + * The entirety of the DatabaseMigrationSqlDb definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DatabaseMigrationSqlDb definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DatabaseMigrationSqlDb definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DatabaseMigrationSqlDb definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sqlDbInstanceName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @return the next definition stage. + */ + WithCreate withExistingServer(String resourceGroupName, String sqlDbInstanceName); + } + + /** + * The stage of the DatabaseMigrationSqlDb definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlDb create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlDb create(Context context); + } + + /** + * The stage of the DatabaseMigrationSqlDb definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL database.. + * + * @param properties Database Migration Resource properties for SQL database. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlDb properties); + } + } + + /** + * Begins update for the DatabaseMigrationSqlDb resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlDb.Update update(); + + /** + * The template for DatabaseMigrationSqlDb update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlDb apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlDb apply(Context context); + } + + /** + * The DatabaseMigrationSqlDb update stages. + */ + interface UpdateStages { + /** + * The stage of the DatabaseMigrationSqlDb update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL database.. + * + * @param properties Database Migration Resource properties for SQL database. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlDb properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlDb refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlDb refresh(Context context); + + /** + * Stop on going migration for the database. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java new file mode 100644 index 000000000000..58b8ca373b07 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlMi.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights 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.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner; + +/** + * An immutable client-side representation of DatabaseMigrationSqlMi. + */ +public interface DatabaseMigrationSqlMi { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL Managed Instance. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlMi properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlMiInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlMiInner innerModel(); + + /** + * The entirety of the DatabaseMigrationSqlMi definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DatabaseMigrationSqlMi definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DatabaseMigrationSqlMi definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DatabaseMigrationSqlMi definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, managedInstanceName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @return the next definition stage. + */ + WithCreate withExistingManagedInstance(String resourceGroupName, String managedInstanceName); + } + + /** + * The stage of the DatabaseMigrationSqlMi definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlMi create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlMi create(Context context); + } + + /** + * The stage of the DatabaseMigrationSqlMi definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Managed Instance.. + * + * @param properties Database Migration Resource properties for SQL Managed Instance. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlMi properties); + } + } + + /** + * Begins update for the DatabaseMigrationSqlMi resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlMi.Update update(); + + /** + * The template for DatabaseMigrationSqlMi update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlMi apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlMi apply(Context context); + } + + /** + * The DatabaseMigrationSqlMi update stages. + */ + interface UpdateStages { + /** + * The stage of the DatabaseMigrationSqlMi update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Managed Instance.. + * + * @param properties Database Migration Resource properties for SQL Managed Instance. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlMi properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlMi refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlMi refresh(Context context); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java new file mode 100644 index 000000000000..6925f5857317 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationSqlVm.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights 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.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner; + +/** + * An immutable client-side representation of DatabaseMigrationSqlVm. + */ +public interface DatabaseMigrationSqlVm { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Database Migration Resource properties for SQL Virtual Machine. + * + * @return the properties value. + */ + DatabaseMigrationPropertiesSqlVm properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationSqlVmInner object. + * + * @return the inner object. + */ + DatabaseMigrationSqlVmInner innerModel(); + + /** + * The entirety of the DatabaseMigrationSqlVm definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The DatabaseMigrationSqlVm definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the DatabaseMigrationSqlVm definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the DatabaseMigrationSqlVm definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sqlVirtualMachineName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @return the next definition stage. + */ + WithCreate withExistingSqlVirtualMachine(String resourceGroupName, String sqlVirtualMachineName); + } + + /** + * The stage of the DatabaseMigrationSqlVm definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DatabaseMigrationSqlVm create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DatabaseMigrationSqlVm create(Context context); + } + + /** + * The stage of the DatabaseMigrationSqlVm definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Virtual Machine.. + * + * @param properties Database Migration Resource properties for SQL Virtual Machine. + * @return the next definition stage. + */ + WithCreate withProperties(DatabaseMigrationPropertiesSqlVm properties); + } + } + + /** + * Begins update for the DatabaseMigrationSqlVm resource. + * + * @return the stage of resource update. + */ + DatabaseMigrationSqlVm.Update update(); + + /** + * The template for DatabaseMigrationSqlVm update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DatabaseMigrationSqlVm apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DatabaseMigrationSqlVm apply(Context context); + } + + /** + * The DatabaseMigrationSqlVm update stages. + */ + interface UpdateStages { + /** + * The stage of the DatabaseMigrationSqlVm update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Database Migration Resource properties for SQL Virtual Machine.. + * + * @param properties Database Migration Resource properties for SQL Virtual Machine. + * @return the next definition stage. + */ + Update withProperties(DatabaseMigrationPropertiesSqlVm properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DatabaseMigrationSqlVm refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DatabaseMigrationSqlVm refresh(Context context); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(MigrationOperationInput parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbRUMongoes.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbRUMongoes.java new file mode 100644 index 000000000000..9ed0e072b199 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbRUMongoes.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights 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 DatabaseMigrationsMongoToCosmosDbRUMongoes. + */ +public interface DatabaseMigrationsMongoToCosmosDbRUMongoes { + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context); + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + DatabaseMigrationCosmosDbMongo get(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + PagedIterable getForScope(String resourceGroupName, String targetResourceName); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + PagedIterable getForScope(String resourceGroupName, String targetResourceName, + Context context); + + /** + * Get Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + DatabaseMigrationCosmosDbMongo getById(String id); + + /** + * Get Database Migration resource. + * + * @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 database Migration resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean force, Context context); + + /** + * Begins definition for a new DatabaseMigrationCosmosDbMongo resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationCosmosDbMongo definition. + */ + DatabaseMigrationCosmosDbMongo.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbvCoreMongoes.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbvCoreMongoes.java new file mode 100644 index 000000000000..a1e1a32e9a93 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsMongoToCosmosDbvCoreMongoes.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; + +/** + * Resource collection API of DatabaseMigrationsMongoToCosmosDbvCoreMongoes. + */ +public interface DatabaseMigrationsMongoToCosmosDbvCoreMongoes { + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String targetResourceName, + String migrationName, Context context); + + /** + * Get Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resource. + */ + DatabaseMigrationCosmosDbMongo get(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + DatabaseMigrationCosmosDbMongo create(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters); + + /** + * Create or Update Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param parameters Details of CosmosDB for Mongo API Migration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for Mongo to CosmosDb. + */ + DatabaseMigrationCosmosDbMongo create(String resourceGroupName, String targetResourceName, String migrationName, + DatabaseMigrationCosmosDbMongoInner parameters, Context context); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String targetResourceName, String migrationName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param migrationName Name of the migration. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String targetResourceName, String migrationName, Boolean force, + Context context); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + PagedIterable getForScope(String resourceGroupName, String targetResourceName); + + /** + * Get Database Migration resources for the scope. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param targetResourceName The name of the target resource/account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration resources for the scope as paginated response with {@link PagedIterable}. + */ + PagedIterable getForScope(String resourceGroupName, String targetResourceName, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.java new file mode 100644 index 000000000000..cc82db925423 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlDbs.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.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * Resource collection API of DatabaseMigrationsSqlDbs. + */ +public interface DatabaseMigrationsSqlDbs { + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String sqlDbInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database. + */ + DatabaseMigrationSqlDb get(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName); + + /** + * Delete Database Migration resource. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlDbInstanceName, String targetDbName, Boolean force, + Context context); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop on going migration for the database. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlDbInstanceName The sqlDbInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String sqlDbInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Retrieve the Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + DatabaseMigrationSqlDb getById(String id); + + /** + * Retrieve the Database Migration resource. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Database along with {@link Response}. + */ + Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration resource. + * + * @param id the resource ID. + * @param force Optional force delete boolean. If this is provided as true, migration will be deleted even if + * active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Boolean force, Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlDb resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlDb definition. + */ + DatabaseMigrationSqlDb.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java new file mode 100644 index 000000000000..34fabcd38c21 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlMis.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * Resource collection API of DatabaseMigrationsSqlMis. + */ +public interface DatabaseMigrationsSqlMis { + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String managedInstanceName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance. + */ + DatabaseMigrationSqlMi get(String resourceGroupName, String managedInstanceName, String targetDbName); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cancel will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL Managed Instance. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param managedInstanceName The managedInstanceName parameter. + * @param targetDbName The name of the target database. + * @param parameters Required migration operation ID for which cutover will be initiated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(String resourceGroupName, String managedInstanceName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + DatabaseMigrationSqlMi getById(String id); + + /** + * Retrieve the specified database migration for a given SQL Managed Instance. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Managed Instance along with {@link Response}. + */ + Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlMi resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlMi definition. + */ + DatabaseMigrationSqlMi.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java new file mode 100644 index 000000000000..eed96f2bed37 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationsSqlVms.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.UUID; + +/** + * Resource collection API of DatabaseMigrationsSqlVms. + */ +public interface DatabaseMigrationsSqlVms { + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String sqlVirtualMachineName, + String targetDbName, UUID migrationOperationId, String expand, Context context); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine. + */ + DatabaseMigrationSqlVm get(String resourceGroupName, String sqlVirtualMachineName, String targetDbName); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Stop in-progress database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cancel(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters); + + /** + * Initiate cutover for in-progress online database migration to SQL VM. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlVirtualMachineName The sqlVirtualMachineName parameter. + * @param targetDbName The name of the target database. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void cutover(String resourceGroupName, String sqlVirtualMachineName, String targetDbName, + MigrationOperationInput parameters, Context context); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + DatabaseMigrationSqlVm getById(String id); + + /** + * Retrieve the specified database migration for a given SQL VM. + * + * @param id the resource ID. + * @param migrationOperationId Optional migration operation ID. If this is provided, then details of migration + * operation for that ID are retrieved. If not provided (default), then details related to most recent or current + * operation are retrieved. + * @param expand Complete migration details be included in the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database Migration Resource for SQL Virtual Machine along with {@link Response}. + */ + Response getByIdWithResponse(String id, UUID migrationOperationId, String expand, + Context context); + + /** + * Begins definition for a new DatabaseMigrationSqlVm resource. + * + * @param name resource name. + * @return the first stage of the new DatabaseMigrationSqlVm definition. + */ + DatabaseMigrationSqlVm.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java new file mode 100644 index 000000000000..59bfeedd8ed2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Table properties. + */ +@Immutable +public final class DatabaseTable implements JsonSerializable { + /* + * Indicates whether table is empty or not + */ + private Boolean hasRows; + + /* + * Schema-qualified name of the table + */ + private String name; + + /** + * Creates an instance of DatabaseTable class. + */ + public DatabaseTable() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatabaseTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatabaseTable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DatabaseTable. + */ + public static DatabaseTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatabaseTable deserializedDatabaseTable = new DatabaseTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hasRows".equals(fieldName)) { + deserializedDatabaseTable.hasRows = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedDatabaseTable.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDatabaseTable; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java new file mode 100644 index 000000000000..db44a1121099 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DeleteNode.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; + +/** + * An immutable client-side representation of DeleteNode. + */ +public interface DeleteNode { + /** + * Gets the nodeName property: The name of node to delete. + * + * @return the nodeName value. + */ + String nodeName(); + + /** + * Gets the integrationRuntimeName property: The name of integration runtime. + * + * @return the integrationRuntimeName value. + */ + String integrationRuntimeName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner object. + * + * @return the inner object. + */ + DeleteNodeInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java new file mode 100644 index 000000000000..9af245fc48c1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorInfo.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Error details. + */ +@Immutable +public final class ErrorInfo implements JsonSerializable { + /* + * Error code. + */ + private String code; + + /* + * Error message. + */ + private String message; + + /** + * Creates an instance of ErrorInfo class. + */ + public ErrorInfo() { + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the ErrorInfo. + */ + public static ErrorInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorInfo deserializedErrorInfo = new ErrorInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedErrorInfo.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedErrorInfo.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorInfo; + }); + } +} 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 cfdea1b8b253..6adcb3d117a9 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 @@ -63,6 +63,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. * @@ -72,6 +83,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. * @@ -81,6 +103,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. * @@ -110,6 +143,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. * @@ -119,6 +163,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. * @@ -140,7 +195,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("executionCount", this.executionCount); + jsonWriter.writeNumberField("cpuTimeMs", this.cpuTimeMs); + jsonWriter.writeNumberField("elapsedTimeMs", this.elapsedTimeMs); jsonWriter.writeMapField("waitStats", this.waitStats, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasErrors", this.hasErrors); + jsonWriter.writeArrayField("sqlErrors", this.sqlErrors, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java similarity index 56% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java index 29107554e1aa..b3812aafe050 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java @@ -9,53 +9,53 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; import java.io.IOException; import java.util.List; /** - * OData page of action (operation) objects. + * OData page of files. */ @Fluent -public final class ServiceOperationList implements JsonSerializable { +public final class FileList implements JsonSerializable { /* - * List of actions + * List of files */ - private List value; + private List value; /* - * URL to load the next page of actions + * URL to load the next page of files */ private String nextLink; /** - * Creates an instance of ServiceOperationList class. + * Creates an instance of FileList class. */ - public ServiceOperationList() { + public FileList() { } /** - * Get the value property: List of actions. + * Get the value property: List of files. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of actions. + * Set the value property: List of files. * * @param value the value value to set. - * @return the ServiceOperationList object itself. + * @return the FileList object itself. */ - public ServiceOperationList withValue(List value) { + public FileList withValue(List value) { this.value = value; return this; } /** - * Get the nextLink property: URL to load the next page of actions. + * Get the nextLink property: URL to load the next page of files. * * @return the nextLink value. */ @@ -64,12 +64,12 @@ public String nextLink() { } /** - * Set the nextLink property: URL to load the next page of actions. + * Set the nextLink property: URL to load the next page of files. * * @param nextLink the nextLink value to set. - * @return the ServiceOperationList object itself. + * @return the FileList object itself. */ - public ServiceOperationList withNextLink(String nextLink) { + public FileList withNextLink(String nextLink) { this.nextLink = nextLink; return this; } @@ -97,32 +97,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ServiceOperationList from the JsonReader. + * Reads an instance of FileList from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ServiceOperationList if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServiceOperationList. + * @return An instance of FileList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FileList. */ - public static ServiceOperationList fromJson(JsonReader jsonReader) throws IOException { + public static FileList fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ServiceOperationList deserializedServiceOperationList = new ServiceOperationList(); + FileList deserializedFileList = new FileList(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ServiceOperationInner.fromJson(reader1)); - deserializedServiceOperationList.value = value; + List value = reader.readArray(reader1 -> ProjectFileInner.fromJson(reader1)); + deserializedFileList.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedServiceOperationList.nextLink = reader.getString(); + deserializedFileList.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedServiceOperationList; + return deserializedFileList; }); } } 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 000000000000..9965c17fe1be --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.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.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 000000000000..6b35b02e27ed --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights 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 { + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * Get files in a project + * + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + Response getWithResponse(String groupName, String serviceName, String projectName, String fileName, + Context context); + + /** + * Get file information + * + * 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); + + /** + * Delete file + * + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String groupName, String serviceName, String projectName, String fileName, + Context context); + + /** + * Delete file + * + * 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); + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context); + + /** + * Request storage information for downloading the file content + * + * 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); + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWriteWithResponse(String groupName, String serviceName, String projectName, + String fileName, Context context); + + /** + * Request information for reading and writing file content. + * + * 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); + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + ProjectFile getById(String id); + + /** + * Get file information + * + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete file + * + * 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); + + /** + * Delete file + * + * This method deletes a file. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProjectFile resource. + * + * @param name resource name. + * @return the first stage of the new ProjectFile definition. + */ + ProjectFile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java index 67618fcda886..53b582c4a020 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that gets TDE certificates in Base64 encoded format. @@ -20,7 +22,7 @@ public final class GetTdeCertificatesSqlTaskProperties extends ProjectTaskProper /* * Task type. */ - private String taskType = "GetTDECertificates.Sql"; + private TaskType taskType = TaskType.GET_TDECERTIFICATES_SQL; /* * Task input @@ -44,7 +46,7 @@ public GetTdeCertificatesSqlTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public GetTdeCertificatesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -128,10 +140,14 @@ public static GetTdeCertificatesSqlTaskProperties fromJson(JsonReader jsonReader } else if ("state".equals(fieldName)) { deserializedGetTdeCertificatesSqlTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedGetTdeCertificatesSqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetTdeCertificatesSqlTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedGetTdeCertificatesSqlTaskProperties.taskType = reader.getString(); + deserializedGetTdeCertificatesSqlTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedGetTdeCertificatesSqlTaskProperties.input = GetTdeCertificatesSqlTaskInput.fromJson(reader); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.java new file mode 100644 index 000000000000..7838af29ebd6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Input for the task that collects user tables for the given list of databases. + */ +@Fluent +public final class GetUserTablesMySqlTaskInput implements JsonSerializable { + /* + * Connection information for SQL Server + */ + private MySqlConnectionInfo connectionInfo; + + /* + * List of database names to collect tables for + */ + private List selectedDatabases; + + /** + * Creates an instance of GetUserTablesMySqlTaskInput class. + */ + public GetUserTablesMySqlTaskInput() { + } + + /** + * Get the connectionInfo property: Connection information for SQL Server. + * + * @return the connectionInfo value. + */ + public MySqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesMySqlTaskInput object itself. + */ + public GetUserTablesMySqlTaskInput withConnectionInfo(MySqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: List of database names to collect tables for. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: List of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the GetUserTablesMySqlTaskInput object itself. + */ + public GetUserTablesMySqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesMySqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesMySqlTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesMySqlTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectionInfo", this.connectionInfo); + jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesMySqlTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesMySqlTaskInput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetUserTablesMySqlTaskInput. + */ + public static GetUserTablesMySqlTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesMySqlTaskInput deserializedGetUserTablesMySqlTaskInput = new GetUserTablesMySqlTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionInfo".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskInput.connectionInfo = MySqlConnectionInfo.fromJson(reader); + } else if ("selectedDatabases".equals(fieldName)) { + List selectedDatabases = reader.readArray(reader1 -> reader1.getString()); + deserializedGetUserTablesMySqlTaskInput.selectedDatabases = selectedDatabases; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesMySqlTaskInput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java new file mode 100644 index 000000000000..978360bcb2d9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskOutput.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Output of the task that collects user tables for the given list of databases. + */ +@Immutable +public final class GetUserTablesMySqlTaskOutput implements JsonSerializable { + /* + * Result identifier + */ + private String id; + + /* + * Mapping from database name to list of tables + */ + private String databasesToTables; + + /* + * Validation errors + */ + private List validationErrors; + + /** + * Creates an instance of GetUserTablesMySqlTaskOutput class. + */ + public GetUserTablesMySqlTaskOutput() { + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the databasesToTables property: Mapping from database name to list of tables. + * + * @return the databasesToTables value. + */ + public String databasesToTables() { + return this.databasesToTables; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesMySqlTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesMySqlTaskOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesMySqlTaskOutput. + */ + public static GetUserTablesMySqlTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesMySqlTaskOutput deserializedGetUserTablesMySqlTaskOutput = new GetUserTablesMySqlTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskOutput.id = reader.getString(); + } else if ("databasesToTables".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskOutput.databasesToTables = reader.getString(); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedGetUserTablesMySqlTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesMySqlTaskOutput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java new file mode 100644 index 000000000000..8d2f4463d6b2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesMySqlTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that collects user tables for the given list of databases. + */ +@Fluent +public final class GetUserTablesMySqlTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.GET_USER_TABLES_MY_SQL; + + /* + * Task input + */ + private GetUserTablesMySqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of GetUserTablesMySqlTaskProperties class. + */ + public GetUserTablesMySqlTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesMySqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesMySqlTaskProperties object itself. + */ + public GetUserTablesMySqlTaskProperties withInput(GetUserTablesMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * {@inheritDoc} + */ + @Override + public GetUserTablesMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesMySqlTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesMySqlTaskProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesMySqlTaskProperties. + */ + public static GetUserTablesMySqlTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesMySqlTaskProperties deserializedGetUserTablesMySqlTaskProperties + = new GetUserTablesMySqlTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedGetUserTablesMySqlTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedGetUserTablesMySqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetUserTablesMySqlTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedGetUserTablesMySqlTaskProperties.input = GetUserTablesMySqlTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> GetUserTablesMySqlTaskOutput.fromJson(reader1)); + deserializedGetUserTablesMySqlTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesMySqlTaskProperties; + }); + } +} 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 000000000000..52c6ed1acfa4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * Information for connecting to Oracle source + */ + private OracleConnectionInfo connectionInfo; + + /* + * List of Oracle schemas for which to collect tables + */ + private List selectedSchemas; + + /** + * Creates an instance of GetUserTablesOracleTaskInput class. + */ + public GetUserTablesOracleTaskInput() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesOracleTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedSchemas() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectedSchemas in model GetUserTablesOracleTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesOracleTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectionInfo", this.connectionInfo); + jsonWriter.writeArrayField("selectedSchemas", this.selectedSchemas, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesOracleTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesOracleTaskInput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetUserTablesOracleTaskInput. + */ + public static GetUserTablesOracleTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesOracleTaskInput deserializedGetUserTablesOracleTaskInput = new GetUserTablesOracleTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionInfo".equals(fieldName)) { + deserializedGetUserTablesOracleTaskInput.connectionInfo = OracleConnectionInfo.fromJson(reader); + } else if ("selectedSchemas".equals(fieldName)) { + List selectedSchemas = reader.readArray(reader1 -> reader1.getString()); + deserializedGetUserTablesOracleTaskInput.selectedSchemas = selectedSchemas; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesOracleTaskInput; + }); + } +} 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 000000000000..3c0685c64fd4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The schema this result is for + */ + private String schemaName; + + /* + * List of valid tables found for this schema + */ + private List tables; + + /* + * Validation errors associated with the task + */ + private List validationErrors; + + /** + * Creates an instance of GetUserTablesOracleTaskOutput class. + */ + public GetUserTablesOracleTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesOracleTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesOracleTaskOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesOracleTaskOutput. + */ + public static GetUserTablesOracleTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesOracleTaskOutput deserializedGetUserTablesOracleTaskOutput + = new GetUserTablesOracleTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("schemaName".equals(fieldName)) { + deserializedGetUserTablesOracleTaskOutput.schemaName = reader.getString(); + } else if ("tables".equals(fieldName)) { + List tables = reader.readArray(reader1 -> DatabaseTable.fromJson(reader1)); + deserializedGetUserTablesOracleTaskOutput.tables = tables; + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedGetUserTablesOracleTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesOracleTaskOutput; + }); + } +} 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 000000000000..769d64c04e77 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that collects user tables for the given list of Oracle schemas. + */ +@Fluent +public final class GetUserTablesOracleTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.GET_USER_TABLES_ORACLE; + + /* + * Task input + */ + private GetUserTablesOracleTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of GetUserTablesOracleTaskProperties class. + */ + public GetUserTablesOracleTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesOracleTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesOracleTaskProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesOracleTaskProperties. + */ + public static GetUserTablesOracleTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesOracleTaskProperties deserializedGetUserTablesOracleTaskProperties + = new GetUserTablesOracleTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedGetUserTablesOracleTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedGetUserTablesOracleTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedGetUserTablesOracleTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetUserTablesOracleTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedGetUserTablesOracleTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedGetUserTablesOracleTaskProperties.input = GetUserTablesOracleTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> GetUserTablesOracleTaskOutput.fromJson(reader1)); + deserializedGetUserTablesOracleTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesOracleTaskProperties; + }); + } +} 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 000000000000..ef35aa949129 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * Information for connecting to PostgreSQL source + */ + private PostgreSqlConnectionInfo connectionInfo; + + /* + * List of PostgreSQL databases for which to collect tables + */ + private List selectedDatabases; + + /** + * Creates an instance of GetUserTablesPostgreSqlTaskInput class. + */ + public GetUserTablesPostgreSqlTaskInput() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesPostgreSqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesPostgreSqlTaskInput")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetUserTablesPostgreSqlTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectionInfo", this.connectionInfo); + jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesPostgreSqlTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesPostgreSqlTaskInput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetUserTablesPostgreSqlTaskInput. + */ + public static GetUserTablesPostgreSqlTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesPostgreSqlTaskInput deserializedGetUserTablesPostgreSqlTaskInput + = new GetUserTablesPostgreSqlTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionInfo".equals(fieldName)) { + deserializedGetUserTablesPostgreSqlTaskInput.connectionInfo + = PostgreSqlConnectionInfo.fromJson(reader); + } else if ("selectedDatabases".equals(fieldName)) { + List selectedDatabases = reader.readArray(reader1 -> reader1.getString()); + deserializedGetUserTablesPostgreSqlTaskInput.selectedDatabases = selectedDatabases; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesPostgreSqlTaskInput; + }); + } +} 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 000000000000..5d563dafa231 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The database this result is for + */ + private String databaseName; + + /* + * List of valid tables found for this database + */ + private List tables; + + /* + * Validation errors associated with the task + */ + private List validationErrors; + + /** + * Creates an instance of GetUserTablesPostgreSqlTaskOutput class. + */ + public GetUserTablesPostgreSqlTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesPostgreSqlTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesPostgreSqlTaskOutput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesPostgreSqlTaskOutput. + */ + public static GetUserTablesPostgreSqlTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesPostgreSqlTaskOutput deserializedGetUserTablesPostgreSqlTaskOutput + = new GetUserTablesPostgreSqlTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedGetUserTablesPostgreSqlTaskOutput.databaseName = reader.getString(); + } else if ("tables".equals(fieldName)) { + List tables = reader.readArray(reader1 -> DatabaseTable.fromJson(reader1)); + deserializedGetUserTablesPostgreSqlTaskOutput.tables = tables; + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedGetUserTablesPostgreSqlTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesPostgreSqlTaskOutput; + }); + } +} 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 000000000000..2b581597a288 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that collects user tables for the given list of databases. + */ +@Fluent +public final class GetUserTablesPostgreSqlTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.GET_USER_TABLES_POSTGRE_SQL; + + /* + * Task input + */ + private GetUserTablesPostgreSqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of GetUserTablesPostgreSqlTaskProperties class. + */ + public GetUserTablesPostgreSqlTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetUserTablesPostgreSqlTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetUserTablesPostgreSqlTaskProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetUserTablesPostgreSqlTaskProperties. + */ + public static GetUserTablesPostgreSqlTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetUserTablesPostgreSqlTaskProperties deserializedGetUserTablesPostgreSqlTaskProperties + = new GetUserTablesPostgreSqlTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedGetUserTablesPostgreSqlTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedGetUserTablesPostgreSqlTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedGetUserTablesPostgreSqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetUserTablesPostgreSqlTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedGetUserTablesPostgreSqlTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedGetUserTablesPostgreSqlTaskProperties.input + = GetUserTablesPostgreSqlTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> GetUserTablesPostgreSqlTaskOutput.fromJson(reader1)); + deserializedGetUserTablesPostgreSqlTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedGetUserTablesPostgreSqlTaskProperties; + }); + } +} 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 f5f33f6afcdd..b38eed59f9a9 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that collects user tables for the given list of databases. @@ -20,7 +22,7 @@ public final class GetUserTablesSqlSyncTaskProperties extends ProjectTaskPropert /* * Task type. */ - private String taskType = "GetUserTables.AzureSqlDb.Sync"; + private TaskType taskType = TaskType.GET_USER_TABLES_AZURE_SQL_DB_SYNC; /* * Task input @@ -44,7 +46,7 @@ public GetUserTablesSqlSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public GetUserTablesSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -128,10 +140,14 @@ public static GetUserTablesSqlSyncTaskProperties fromJson(JsonReader jsonReader) } else if ("state".equals(fieldName)) { deserializedGetUserTablesSqlSyncTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedGetUserTablesSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetUserTablesSqlSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedGetUserTablesSqlSyncTaskProperties.taskType = reader.getString(); + deserializedGetUserTablesSqlSyncTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedGetUserTablesSqlSyncTaskProperties.input = GetUserTablesSqlSyncTaskInput.fromJson(reader); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java index 6f0d6818dd64..3c29ef754b16 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java @@ -28,6 +28,11 @@ public final class GetUserTablesSqlTaskInput implements JsonSerializable selectedDatabases; + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + /** * Creates an instance of GetUserTablesSqlTaskInput class. */ @@ -74,6 +79,26 @@ public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedData return this; } + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * Validates the instance. * @@ -105,6 +130,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("connectionInfo", this.connectionInfo); jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); return jsonWriter.writeEndObject(); } @@ -129,6 +155,8 @@ public static GetUserTablesSqlTaskInput fromJson(JsonReader jsonReader) throws I } else if ("selectedDatabases".equals(fieldName)) { List selectedDatabases = reader.readArray(reader1 -> reader1.getString()); deserializedGetUserTablesSqlTaskInput.selectedDatabases = selectedDatabases; + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedGetUserTablesSqlTaskInput.encryptedKeyForSecureFields = reader.getString(); } else { reader.skipChildren(); } 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 8e8c86678b4c..1132adc61bbf 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that collects user tables for the given list of databases. @@ -20,7 +22,7 @@ public final class GetUserTablesSqlTaskProperties extends ProjectTaskProperties /* * Task type. */ - private String taskType = "GetUserTables.Sql"; + private TaskType taskType = TaskType.GET_USER_TABLES_SQL; /* * Task input @@ -32,6 +34,11 @@ public final class GetUserTablesSqlTaskProperties extends ProjectTaskProperties */ private List output; + /* + * Task id + */ + private String taskId; + /** * Creates an instance of GetUserTablesSqlTaskProperties class. */ @@ -44,7 +51,7 @@ public GetUserTablesSqlTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +84,35 @@ public List output() { return this.output; } + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GetUserTablesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +137,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("taskId", this.taskId); return jsonWriter.writeEndObject(); } @@ -128,16 +166,22 @@ public static GetUserTablesSqlTaskProperties fromJson(JsonReader jsonReader) thr } else if ("state".equals(fieldName)) { deserializedGetUserTablesSqlTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedGetUserTablesSqlTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedGetUserTablesSqlTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedGetUserTablesSqlTaskProperties.taskType = reader.getString(); + deserializedGetUserTablesSqlTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedGetUserTablesSqlTaskProperties.input = GetUserTablesSqlTaskInput.fromJson(reader); } else if ("output".equals(fieldName)) { List output = reader.readArray(reader1 -> GetUserTablesSqlTaskOutput.fromJson(reader1)); deserializedGetUserTablesSqlTaskProperties.output = output; + } else if ("taskId".equals(fieldName)) { + deserializedGetUserTablesSqlTaskProperties.taskId = reader.getString(); } else { reader.skipChildren(); } 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 000000000000..fee6e918a139 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for the service task to install an OCI driver. + */ +@Fluent +public final class InstallOciDriverTaskInput implements JsonSerializable { + /* + * Name of the uploaded driver package to install. + */ + private String driverPackageName; + + /** + * Creates an instance of InstallOciDriverTaskInput class. + */ + public InstallOciDriverTaskInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("driverPackageName", this.driverPackageName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstallOciDriverTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstallOciDriverTaskInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstallOciDriverTaskInput. + */ + public static InstallOciDriverTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstallOciDriverTaskInput deserializedInstallOciDriverTaskInput = new InstallOciDriverTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driverPackageName".equals(fieldName)) { + deserializedInstallOciDriverTaskInput.driverPackageName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstallOciDriverTaskInput; + }); + } +} 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 000000000000..b469aec4ca74 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Output for the service task to install an OCI driver. + */ +@Immutable +public final class InstallOciDriverTaskOutput implements JsonSerializable { + /* + * Validation errors + */ + private List validationErrors; + + /** + * Creates an instance of InstallOciDriverTaskOutput class. + */ + public InstallOciDriverTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstallOciDriverTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstallOciDriverTaskOutput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstallOciDriverTaskOutput. + */ + public static InstallOciDriverTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstallOciDriverTaskOutput deserializedInstallOciDriverTaskOutput = new InstallOciDriverTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedInstallOciDriverTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedInstallOciDriverTaskOutput; + }); + } +} 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 000000000000..111ffebdd5bb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that installs an OCI driver. + */ +@Fluent +public final class InstallOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.SERVICE_INSTALL_OCI; + + /* + * Input for the service task to install an OCI driver. + */ + private InstallOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of InstallOciDriverTaskProperties class. + */ + public InstallOciDriverTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstallOciDriverTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstallOciDriverTaskProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InstallOciDriverTaskProperties. + */ + public static InstallOciDriverTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstallOciDriverTaskProperties deserializedInstallOciDriverTaskProperties + = new InstallOciDriverTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedInstallOciDriverTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedInstallOciDriverTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedInstallOciDriverTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedInstallOciDriverTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedInstallOciDriverTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedInstallOciDriverTaskProperties.input = InstallOciDriverTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> InstallOciDriverTaskOutput.fromJson(reader1)); + deserializedInstallOciDriverTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedInstallOciDriverTaskProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java new file mode 100644 index 000000000000..b3fbb039b9d7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/IntegrationRuntimeMonitoringData.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner; +import java.util.List; + +/** + * An immutable client-side representation of IntegrationRuntimeMonitoringData. + */ +public interface IntegrationRuntimeMonitoringData { + /** + * Gets the name property: The name of Integration Runtime. + * + * @return the name value. + */ + String name(); + + /** + * Gets the nodes property: Integration Runtime node monitoring data. + * + * @return the nodes value. + */ + List nodes(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.IntegrationRuntimeMonitoringDataInner + * object. + * + * @return the inner object. + */ + IntegrationRuntimeMonitoringDataInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..df115018309b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentityType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..1f9470091832 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ManagedServiceIdentityType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} 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 d454c3452aa2..e9b9fec1c719 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 @@ -9,6 +9,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; @@ -16,11 +17,11 @@ * Properties for the command that completes online migration for an Azure SQL Database Managed Instance. */ @Fluent -public final class MigrateMISyncCompleteCommandProperties extends CommandProperties { +public final class MigrateMISyncCompleteCommandProperties extends CommandPropertiesInner { /* * Command type. */ - private String commandType = "Migrate.SqlServer.AzureDbSqlMi.Complete"; + private CommandType commandType = CommandType.MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE; /* * Command input @@ -32,6 +33,16 @@ public final class MigrateMISyncCompleteCommandProperties extends CommandPropert */ private MigrateMISyncCompleteCommandOutput output; + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + /** * Creates an instance of MigrateMISyncCompleteCommandProperties class. */ @@ -44,7 +55,7 @@ public MigrateMISyncCompleteCommandProperties() { * @return the commandType value. */ @Override - public String commandType() { + public CommandType commandType() { return this.commandType; } @@ -77,6 +88,26 @@ public MigrateMISyncCompleteCommandOutput output() { return this.output; } + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + @Override + public CommandState state() { + return this.state; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + @Override + public List errors() { + return this.errors; + } + /** * Validates the instance. * @@ -98,7 +129,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commandType", this.commandType); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -121,12 +152,13 @@ public static MigrateMISyncCompleteCommandProperties fromJson(JsonReader jsonRea if ("errors".equals(fieldName)) { List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedMigrateMISyncCompleteCommandProperties.withErrors(errors); + deserializedMigrateMISyncCompleteCommandProperties.errors = errors; } else if ("state".equals(fieldName)) { - deserializedMigrateMISyncCompleteCommandProperties - .withState(CommandState.fromString(reader.getString())); + deserializedMigrateMISyncCompleteCommandProperties.state + = CommandState.fromString(reader.getString()); } else if ("commandType".equals(fieldName)) { - deserializedMigrateMISyncCompleteCommandProperties.commandType = reader.getString(); + deserializedMigrateMISyncCompleteCommandProperties.commandType + = CommandType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateMISyncCompleteCommandProperties.input = MigrateMISyncCompleteCommandInput.fromJson(reader); 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 000000000000..663cc4fb6a60 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that migrates data between MongoDB data sources. + */ +@Fluent +public final class MigrateMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.MIGRATE_MONGO_DB; + + /* + * Describes how a MongoDB data migration should be performed + */ + private MongoDbMigrationSettings input; + + /* + * The output property. + */ + private List output; + + /** + * Creates an instance of MigrateMongoDbTaskProperties class. + */ + public MigrateMongoDbTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMongoDbTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMongoDbTaskProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMongoDbTaskProperties. + */ + public static MigrateMongoDbTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateMongoDbTaskProperties deserializedMigrateMongoDbTaskProperties = new MigrateMongoDbTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMigrateMongoDbTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedMigrateMongoDbTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedMigrateMongoDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMongoDbTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedMigrateMongoDbTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMigrateMongoDbTaskProperties.input = MongoDbMigrationSettings.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output = reader.readArray(reader1 -> MongoDbProgress.fromJson(reader1)); + deserializedMigrateMongoDbTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMongoDbTaskProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.java new file mode 100644 index 000000000000..ce17c27d37e9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Database specific information for offline MySQL to Azure Database for MySQL migration task inputs. + */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput + implements JsonSerializable { + /* + * Name of the database + */ + private String name; + + /* + * Name of target database. Note: Target database will be truncated before starting migration. + */ + private String targetDatabaseName; + + /* + * Mapping of source to target tables + */ + private Map tableMap; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineDatabaseInput class. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput() { + } + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName); + jsonWriter.writeMapField("tableMap", this.tableMap, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineDatabaseInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineDatabaseInput if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineDatabaseInput. + */ + public static MigrateMySqlAzureDbForMySqlOfflineDatabaseInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineDatabaseInput deserializedMigrateMySqlAzureDbForMySqlOfflineDatabaseInput + = new MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineDatabaseInput.name = reader.getString(); + } else if ("targetDatabaseName".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineDatabaseInput.targetDatabaseName = reader.getString(); + } else if ("tableMap".equals(fieldName)) { + Map tableMap = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMySqlAzureDbForMySqlOfflineDatabaseInput.tableMap = tableMap; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineDatabaseInput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java new file mode 100644 index 000000000000..65627cc987cb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskInput.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Input for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. + */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskInput + implements JsonSerializable { + /* + * Connection information for source MySQL + */ + private MySqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target Azure Database for MySQL + */ + private MySqlConnectionInfo targetConnectionInfo; + + /* + * Databases to migrate + */ + private List selectedDatabases; + + /* + * Setting to set the source server read only + */ + private Boolean makeSourceServerReadOnly; + + /* + * Parameter to specify when the migration started + */ + private OffsetDateTime startedOn; + + /* + * Optional parameters for fine tuning the data transfer rate during migration + */ + private Map optionalAgentSettings; + + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskInput class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput() { + } + + /** + * Get the sourceConnectionInfo property: Connection information for source MySQL. + * + * @return the sourceConnectionInfo value. + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source MySQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput + withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @return the targetConnectionInfo value. + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput + withTargetConnectionInfo(MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput + withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the makeSourceServerReadOnly property: Setting to set the source server read only. + * + * @return the makeSourceServerReadOnly value. + */ + public Boolean makeSourceServerReadOnly() { + return this.makeSourceServerReadOnly; + } + + /** + * Set the makeSourceServerReadOnly property: Setting to set the source server read only. + * + * @param makeSourceServerReadOnly the makeSourceServerReadOnly value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withMakeSourceServerReadOnly(Boolean makeSourceServerReadOnly) { + this.makeSourceServerReadOnly = makeSourceServerReadOnly; + return this; + } + + /** + * Get the startedOn property: Parameter to specify when the migration started. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Parameter to specify when the migration started. + * + * @param startedOn the startedOn value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the optionalAgentSettings property: Optional parameters for fine tuning the data transfer rate during + * migration. + * + * @return the optionalAgentSettings value. + */ + public Map optionalAgentSettings() { + return this.optionalAgentSettings; + } + + /** + * Set the optionalAgentSettings property: Optional parameters for fine tuning the data transfer rate during + * migration. + * + * @param optionalAgentSettings the optionalAgentSettings value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput + withOptionalAgentSettings(Map optionalAgentSettings) { + this.optionalAgentSettings = optionalAgentSettings; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput + withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetConnectionInfo in model MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateMySqlAzureDbForMySqlOfflineTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateMySqlAzureDbForMySqlOfflineTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); + jsonWriter.writeJsonField("targetConnectionInfo", this.targetConnectionInfo); + jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("makeSourceServerReadOnly", this.makeSourceServerReadOnly); + jsonWriter.writeStringField("startedOn", + this.startedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedOn)); + jsonWriter.writeMapField("optionalAgentSettings", this.optionalAgentSettings, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskInput if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineTaskInput. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskInput deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput + = new MigrateMySqlAzureDbForMySqlOfflineTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceConnectionInfo".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.sourceConnectionInfo + = MySqlConnectionInfo.fromJson(reader); + } else if ("targetConnectionInfo".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.targetConnectionInfo + = MySqlConnectionInfo.fromJson(reader); + } else if ("selectedDatabases".equals(fieldName)) { + List selectedDatabases = reader + .readArray(reader1 -> MigrateMySqlAzureDbForMySqlOfflineDatabaseInput.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.selectedDatabases = selectedDatabases; + } else if ("makeSourceServerReadOnly".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.makeSourceServerReadOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("optionalAgentSettings".equals(fieldName)) { + Map optionalAgentSettings = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.optionalAgentSettings + = optionalAgentSettings; + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput.encryptedKeyForSecureFields + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskInput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java new file mode 100644 index 000000000000..f73b0a9f47f0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutput.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. + */ +@Immutable +public class MigrateMySqlAzureDbForMySqlOfflineTaskOutput + implements JsonSerializable { + /* + * Result type + */ + private String resultType = "MigrateMySqlAzureDbForMySqlOfflineTaskOutput"; + + /* + * Result identifier + */ + private String id; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutput class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutput() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + public String resultType() { + return this.resultType; + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Result identifier. + * + * @param id the id value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskOutput object itself. + */ + MigrateMySqlAzureDbForMySqlOfflineTaskOutput withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutput if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineTaskOutput. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resultType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("MigrationLevelOutput".equals(discriminatorValue)) { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.fromJson(readerToUse.reset()); + } else if ("DatabaseLevelOutput".equals(discriminatorValue)) { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.fromJson(readerToUse.reset()); + } else if ("TableLevelOutput".equals(discriminatorValue)) { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.fromJson(readerToUse.reset()); + } else if ("ErrorOutput".equals(discriminatorValue)) { + return MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MigrateMySqlAzureDbForMySqlOfflineTaskOutput fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutput + = new MigrateMySqlAzureDbForMySqlOfflineTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutput.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutput.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..cde8510a144f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel model. + */ +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Result type + */ + private String resultType = "DatabaseLevelOutput"; + + /* + * Name of the database + */ + private String databaseName; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + private MigrationState state; + + /* + * Migration stage that this database is in + */ + private DatabaseMigrationStage stage; + + /* + * Status message + */ + private String statusMessage; + + /* + * Migration progress message + */ + private String message; + + /* + * Number of objects + */ + private Long numberOfObjects; + + /* + * Number of successfully completed objects + */ + private Long numberOfObjectsCompleted; + + /* + * Number of database/object errors. + */ + private Long errorCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the item + */ + private String resultPrefix; + + /* + * Migration exceptions and warnings. + */ + private List exceptionsAndWarnings; + + /* + * Last time the storage was updated + */ + private OffsetDateTime lastStorageUpdate; + + /* + * Summary of object results in the migration + */ + private String objectSummary; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Migration stage that this database is in. + * + * @return the stage value. + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the numberOfObjects property: Number of objects. + * + * @return the numberOfObjects value. + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get the numberOfObjectsCompleted property: Number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value. + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get the errorCount property: Number of database/object errors. + * + * @return the errorCount value. + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Get the objectSummary property: Summary of object results in the migration. + * + * @return the objectSummary value. + */ + public String objectSummary() { + return this.objectSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + = new MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.resultType + = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.databaseName + = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.state + = MigrationState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.stage + = DatabaseMigrationStage.fromString(reader.getString()); + } else if ("statusMessage".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.statusMessage + = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.message = reader.getString(); + } else if ("numberOfObjects".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.numberOfObjects + = reader.getNullable(JsonReader::getLong); + } else if ("numberOfObjectsCompleted".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.numberOfObjectsCompleted + = reader.getNullable(JsonReader::getLong); + } else if ("errorCount".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.errorCount + = reader.getNullable(JsonReader::getLong); + } else if ("errorPrefix".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.errorPrefix + = reader.getString(); + } else if ("resultPrefix".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.resultPrefix + = reader.getString(); + } else if ("exceptionsAndWarnings".equals(fieldName)) { + List exceptionsAndWarnings + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.exceptionsAndWarnings + = exceptionsAndWarnings; + } else if ("lastStorageUpdate".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.lastStorageUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("objectSummary".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.objectSummary + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java new file mode 100644 index 000000000000..a2000c4017b8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MigrateMySqlAzureDbForMySqlOfflineTaskOutputError model. + */ +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Result type + */ + private String resultType = "ErrorOutput"; + + /* + * Migration error + */ + private ReportableException error; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputError class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputError() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (error() != null) { + error().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputError if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineTaskOutputError. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskOutputError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskOutputError deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputError + = new MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputError.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputError.resultType = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputError.error + = ReportableException.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputError; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..16dff74866f9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel model. + */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Result type + */ + private String resultType = "MigrationLevelOutput"; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Duration of task execution in seconds. + */ + private Long durationInSeconds; + + /* + * Current status of migration + */ + private MigrationStatus status; + + /* + * Migration status message + */ + private String statusMessage; + + /* + * Migration progress message + */ + private String message; + + /* + * Selected databases as a map from database name to database id + */ + private String databases; + + /* + * Summary of database results in the migration + */ + private String databaseSummary; + + /* + * Migration Report Result, provides unique url for downloading your migration report. + */ + private MigrationReportResult migrationReportResult; + + /* + * Source server version + */ + private String sourceServerVersion; + + /* + * Source server brand version + */ + private String sourceServerBrandVersion; + + /* + * Target server version + */ + private String targetServerVersion; + + /* + * Target server brand version + */ + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + private List exceptionsAndWarnings; + + /* + * Last time the storage was updated + */ + private OffsetDateTime lastStorageUpdate; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the durationInSeconds property: Duration of task execution in seconds. + * + * @return the durationInSeconds value. + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the statusMessage property: Migration status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the databases property: Selected databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Set the databases property: Selected databases as a map from database name to database id. + * + * @param databases the databases value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel withDatabases(String databases) { + this.databases = databases; + return this; + } + + /** + * Get the databaseSummary property: Summary of database results in the migration. + * + * @return the databaseSummary value. + */ + public String databaseSummary() { + return this.databaseSummary; + } + + /** + * Get the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @return the migrationReportResult value. + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @param migrationReportResult the migrationReportResult value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + withMigrationReportResult(MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (migrationReportResult() != null) { + migrationReportResult().validate(); + } + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + jsonWriter.writeStringField("databases", this.databases); + jsonWriter.writeJsonField("migrationReportResult", this.migrationReportResult); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + = new MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.resultType + = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("durationInSeconds".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.durationInSeconds + = reader.getNullable(JsonReader::getLong); + } else if ("status".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.status + = MigrationStatus.fromString(reader.getString()); + } else if ("statusMessage".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.statusMessage + = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.message = reader.getString(); + } else if ("databases".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.databases + = reader.getString(); + } else if ("databaseSummary".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.databaseSummary + = reader.getString(); + } else if ("migrationReportResult".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.migrationReportResult + = MigrationReportResult.fromJson(reader); + } else if ("sourceServerVersion".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.sourceServerVersion + = reader.getString(); + } else if ("sourceServerBrandVersion".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.sourceServerBrandVersion + = reader.getString(); + } else if ("targetServerVersion".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.targetServerVersion + = reader.getString(); + } else if ("targetServerBrandVersion".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.targetServerBrandVersion + = reader.getString(); + } else if ("exceptionsAndWarnings".equals(fieldName)) { + List exceptionsAndWarnings + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.exceptionsAndWarnings + = exceptionsAndWarnings; + } else if ("lastStorageUpdate".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.lastStorageUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java new file mode 100644 index 000000000000..65fe20ab982d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel model. + */ +@Immutable +public final class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + extends MigrateMySqlAzureDbForMySqlOfflineTaskOutput { + /* + * Result type + */ + private String resultType = "TableLevelOutput"; + + /* + * Name of the item + */ + private String objectName; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + private MigrationState state; + + /* + * Status message + */ + private String statusMessage; + + /* + * Number of items + */ + private Long itemsCount; + + /* + * Number of successfully completed items + */ + private Long itemsCompletedCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the item + */ + private String resultPrefix; + + /* + * Last time the storage was updated + */ + private OffsetDateTime lastStorageUpdate; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * Get the objectName property: Name of the item. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the itemsCount property: Number of items. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get the itemsCompletedCount property: Number of successfully completed items. + * + * @return the itemsCompletedCount value. + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get the lastStorageUpdate property: Last time the storage was updated. + * + * @return the lastStorageUpdate value. + */ + public OffsetDateTime lastStorageUpdate() { + return this.lastStorageUpdate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + = new MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.resultType = reader.getString(); + } else if ("objectName".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.objectName = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.state + = MigrationState.fromString(reader.getString()); + } else if ("statusMessage".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.statusMessage + = reader.getString(); + } else if ("itemsCount".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.itemsCount + = reader.getNullable(JsonReader::getLong); + } else if ("itemsCompletedCount".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.itemsCompletedCount + = reader.getNullable(JsonReader::getLong); + } else if ("errorPrefix".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.errorPrefix = reader.getString(); + } else if ("resultPrefix".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.resultPrefix + = reader.getString(); + } else if ("lastStorageUpdate".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.lastStorageUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java new file mode 100644 index 000000000000..637234908341 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlOfflineTaskProperties.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline migrations. + */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlOfflineTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL; + + /* + * Task input + */ + private MigrateMySqlAzureDbForMySqlOfflineTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /* + * whether the task can be cloned or not + */ + private Boolean isCloneable; + + /* + * Task id + */ + private String taskId; + + /** + * Creates an instance of MigrateMySqlAzureDbForMySqlOfflineTaskProperties class. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties + withInput(MigrateMySqlAzureDbForMySqlOfflineTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the MigrateMySqlAzureDbForMySqlOfflineTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateMySqlAzureDbForMySqlOfflineTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeBooleanField("isCloneable", this.isCloneable); + jsonWriter.writeStringField("taskId", this.taskId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateMySqlAzureDbForMySqlOfflineTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateMySqlAzureDbForMySqlOfflineTaskProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateMySqlAzureDbForMySqlOfflineTaskProperties. + */ + public static MigrateMySqlAzureDbForMySqlOfflineTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateMySqlAzureDbForMySqlOfflineTaskProperties deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties + = new MigrateMySqlAzureDbForMySqlOfflineTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.input + = MigrateMySqlAzureDbForMySqlOfflineTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> MigrateMySqlAzureDbForMySqlOfflineTaskOutput.fromJson(reader1)); + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.output = output; + } else if ("isCloneable".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.isCloneable + = reader.getNullable(JsonReader::getBoolean); + } else if ("taskId".equals(fieldName)) { + deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties.taskId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateMySqlAzureDbForMySqlOfflineTaskProperties; + }); + } +} 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 16545b7c0dcd..4759be46a8b4 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 @@ -43,6 +43,11 @@ public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInput */ private Map targetSetting; + /* + * Mapping of source to target tables + */ + private Map tableMap; + /** * Creates an instance of MigrateMySqlAzureDbForMySqlSyncDatabaseInput class. */ @@ -151,6 +156,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. * @@ -171,6 +196,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeString(element)); jsonWriter.writeMapField("sourceSetting", this.sourceSetting, (writer, element) -> writer.writeString(element)); jsonWriter.writeMapField("targetSetting", this.targetSetting, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tableMap", this.tableMap, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -203,6 +229,9 @@ public static MigrateMySqlAzureDbForMySqlSyncDatabaseInput fromJson(JsonReader j } else if ("targetSetting".equals(fieldName)) { Map targetSetting = reader.readMap(reader1 -> reader1.getString()); deserializedMigrateMySqlAzureDbForMySqlSyncDatabaseInput.targetSetting = targetSetting; + } else if ("tableMap".equals(fieldName)) { + Map tableMap = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMySqlAzureDbForMySqlSyncDatabaseInput.tableMap = tableMap; } else { reader.skipChildren(); } 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 f1b3f7aa84d9..752d7bf514c8 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. @@ -20,7 +22,7 @@ public final class MigrateMySqlAzureDbForMySqlSyncTaskProperties extends Project /* * Task type. */ - private String taskType = "Migrate.MySql.AzureDbForMySql.Sync"; + private TaskType taskType = TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC; /* * Task input @@ -44,7 +46,7 @@ public MigrateMySqlAzureDbForMySqlSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public MigrateMySqlAzureDbForMySqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static MigrateMySqlAzureDbForMySqlSyncTaskProperties fromJson(JsonReader deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties.taskType = reader.getString(); + deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateMySqlAzureDbForMySqlSyncTaskProperties.input = MigrateMySqlAzureDbForMySqlSyncTaskInput.fromJson(reader); 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 000000000000..150c6ed1be06 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations. + */ +@Fluent +public final class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC; + + /* + * Task input + */ + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of MigrateOracleAzureDbForPostgreSqlSyncTaskProperties class. + */ + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbForPostgreSqlSyncTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbForPostgreSqlSyncTaskProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbForPostgreSqlSyncTaskProperties. + */ + public static MigrateOracleAzureDbForPostgreSqlSyncTaskProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbForPostgreSqlSyncTaskProperties deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties + = new MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.input + = MigrateOracleAzureDbPostgreSqlSyncTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> MigrateOracleAzureDbPostgreSqlSyncTaskOutput.fromJson(reader1)); + deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbForPostgreSqlSyncTaskProperties; + }); + } +} 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 000000000000..5bc7d953209a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs. + */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + implements JsonSerializable { + /* + * How to handle object name casing: either Preserve or ToLower + */ + private String caseManipulation; + + /* + * Name of the migration pipeline + */ + private String name; + + /* + * Name of the source schema + */ + private String schemaName; + + /* + * Mapping of source to target tables + */ + private Map tableMap; + + /* + * Name of target database. Note: Target database will be truncated before starting migration. + */ + private String targetDatabaseName; + + /* + * Migration settings which tune the migration behavior + */ + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + private Map targetSetting; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncDatabaseInput class. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("caseManipulation", this.caseManipulation); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("schemaName", this.schemaName); + jsonWriter.writeMapField("tableMap", this.tableMap, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName); + jsonWriter.writeMapField("migrationSetting", this.migrationSetting, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("sourceSetting", this.sourceSetting, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("targetSetting", this.targetSetting, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncDatabaseInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncDatabaseInput if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput. + */ + public static MigrateOracleAzureDbPostgreSqlSyncDatabaseInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncDatabaseInput deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput + = new MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("caseManipulation".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.caseManipulation = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.name = reader.getString(); + } else if ("schemaName".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.schemaName = reader.getString(); + } else if ("tableMap".equals(fieldName)) { + Map tableMap = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.tableMap = tableMap; + } else if ("targetDatabaseName".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.targetDatabaseName = reader.getString(); + } else if ("migrationSetting".equals(fieldName)) { + Map migrationSetting = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.migrationSetting = migrationSetting; + } else if ("sourceSetting".equals(fieldName)) { + Map sourceSetting = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.sourceSetting = sourceSetting; + } else if ("targetSetting".equals(fieldName)) { + Map targetSetting = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput.targetSetting = targetSetting; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncDatabaseInput; + }); + } +} 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 000000000000..5cec6289abb9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * Databases to migrate + */ + private List selectedDatabases; + + /* + * Connection information for target Azure Database for PostgreSQL + */ + private PostgreSqlConnectionInfo targetConnectionInfo; + + /* + * Connection information for source Oracle + */ + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskInput class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (targetConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetConnectionInfo in model MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (sourceConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("targetConnectionInfo", this.targetConnectionInfo); + jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskInput if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbPostgreSqlSyncTaskInput. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskInput deserializedMigrateOracleAzureDbPostgreSqlSyncTaskInput + = new MigrateOracleAzureDbPostgreSqlSyncTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("selectedDatabases".equals(fieldName)) { + List selectedDatabases = reader + .readArray(reader1 -> MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.fromJson(reader1)); + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskInput.selectedDatabases = selectedDatabases; + } else if ("targetConnectionInfo".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskInput.targetConnectionInfo + = PostgreSqlConnectionInfo.fromJson(reader); + } else if ("sourceConnectionInfo".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskInput.sourceConnectionInfo + = OracleConnectionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskInput; + }); + } +} 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 000000000000..93d0563e300b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. + */ +@Immutable +public class MigrateOracleAzureDbPostgreSqlSyncTaskOutput + implements JsonSerializable { + /* + * Result type + */ + private String resultType = "MigrateOracleAzureDbPostgreSqlSyncTaskOutput"; + + /* + * Result identifier + */ + private String id; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutput class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutput() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + public String resultType() { + return this.resultType; + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Result identifier. + * + * @param id the id value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskOutput object itself. + */ + MigrateOracleAzureDbPostgreSqlSyncTaskOutput withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutput if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbPostgreSqlSyncTaskOutput. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resultType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("MigrationLevelOutput".equals(discriminatorValue)) { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.fromJson(readerToUse.reset()); + } else if ("DatabaseLevelOutput".equals(discriminatorValue)) { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.fromJson(readerToUse.reset()); + } else if ("TableLevelOutput".equals(discriminatorValue)) { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.fromJson(readerToUse.reset()); + } else if ("ErrorOutput".equals(discriminatorValue)) { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.fromJson(readerToUse.reset()); + } else if ("DatabaseLevelErrorOutput".equals(discriminatorValue)) { + return MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MigrateOracleAzureDbPostgreSqlSyncTaskOutput fromJsonKnownDiscriminator(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutput + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutput.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutput.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutput; + }); + } +} 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 000000000000..4a563fd876b5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError model. + */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result type + */ + private String resultType = "DatabaseLevelErrorOutput"; + + /* + * Error message + */ + private String errorMessage; + + /* + * List of error events. + */ + private List events; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (events() != null) { + events().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.resultType + = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.errorMessage + = reader.getString(); + } else if ("events".equals(fieldName)) { + List events + = reader.readArray(reader1 -> SyncMigrationDatabaseErrorEvent.fromJson(reader1)); + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.events = events; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError; + }); + } +} 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 000000000000..567cd40d4253 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel model. + */ +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result type + */ + private String resultType = "DatabaseLevelOutput"; + + /* + * Name of the database + */ + private String databaseName; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + private Long incomingChanges; + + /* + * Number of applied changes + */ + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + private Long latency; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.resultType + = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.databaseName + = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrationState".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.migrationState + = SyncDatabaseMigrationReportingState.fromString(reader.getString()); + } else if ("incomingChanges".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.incomingChanges + = reader.getNullable(JsonReader::getLong); + } else if ("appliedChanges".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.appliedChanges + = reader.getNullable(JsonReader::getLong); + } else if ("cdcInsertCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cdcInsertCounter + = reader.getNullable(JsonReader::getLong); + } else if ("cdcDeleteCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cdcDeleteCounter + = reader.getNullable(JsonReader::getLong); + } else if ("cdcUpdateCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cdcUpdateCounter + = reader.getNullable(JsonReader::getLong); + } else if ("fullLoadCompletedTables".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.fullLoadCompletedTables + = reader.getNullable(JsonReader::getLong); + } else if ("fullLoadLoadingTables".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.fullLoadLoadingTables + = reader.getNullable(JsonReader::getLong); + } else if ("fullLoadQueuedTables".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.fullLoadQueuedTables + = reader.getNullable(JsonReader::getLong); + } else if ("fullLoadErroredTables".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.fullLoadErroredTables + = reader.getNullable(JsonReader::getLong); + } else if ("initializationCompleted".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.initializationCompleted + = reader.getNullable(JsonReader::getBoolean); + } else if ("latency".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.latency + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel; + }); + } +} 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 000000000000..7e435f4ed069 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MigrateOracleAzureDbPostgreSqlSyncTaskOutputError model. + */ +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result type + */ + private String resultType = "ErrorOutput"; + + /* + * Migration error + */ + private ReportableException error; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputError class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputError() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (error() != null) { + error().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputError if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbPostgreSqlSyncTaskOutputError. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutputError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutputError deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputError + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputError.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputError.resultType = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputError.error + = ReportableException.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputError; + }); + } +} 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 000000000000..68b7d6641dce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel model. + */ +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result type + */ + private String resultType = "MigrationLevelOutput"; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Source server version + */ + private String sourceServerVersion; + + /* + * Source server name + */ + private String sourceServer; + + /* + * Target server version + */ + private String targetServerVersion; + + /* + * Target server name + */ + private String targetServer; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.resultType + = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sourceServerVersion".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.sourceServerVersion + = reader.getString(); + } else if ("sourceServer".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.sourceServer + = reader.getString(); + } else if ("targetServerVersion".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.targetServerVersion + = reader.getString(); + } else if ("targetServer".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.targetServer + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel; + }); + } +} 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 000000000000..7e0b31d7b622 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel model. + */ +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + /* + * Result type + */ + private String resultType = "TableLevelOutput"; + + /* + * Name of the table + */ + private String tableName; + + /* + * Name of the database + */ + private String databaseName; + + /* + * Number of applied inserts + */ + private Long cdcInsertCounter; + + /* + * Number of applied updates + */ + private Long cdcUpdateCounter; + + /* + * Number of applied deletes + */ + private Long cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + private OffsetDateTime lastModifiedTime; + + /** + * Creates an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel class. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel. + */ + public static MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + = new MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.resultType = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.tableName = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.databaseName + = reader.getString(); + } else if ("cdcInsertCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cdcInsertCounter + = reader.getNullable(JsonReader::getLong); + } else if ("cdcUpdateCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cdcUpdateCounter + = reader.getNullable(JsonReader::getLong); + } else if ("cdcDeleteCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cdcDeleteCounter + = reader.getNullable(JsonReader::getLong); + } else if ("fullLoadEstFinishTime".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.fullLoadEstFinishTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fullLoadStartedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.fullLoadStartedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fullLoadEndedOn".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.fullLoadEndedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fullLoadTotalRows".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.fullLoadTotalRows + = reader.getNullable(JsonReader::getLong); + } else if ("state".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.state + = SyncTableMigrationState.fromString(reader.getString()); + } else if ("totalChangesApplied".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.totalChangesApplied + = reader.getNullable(JsonReader::getLong); + } else if ("dataErrorsCounter".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.dataErrorsCounter + = reader.getNullable(JsonReader::getLong); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel; + }); + } +} 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 2d0881a13c16..d499fd3524ef 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 @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -23,6 +24,11 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput */ private String name; + /* + * Result identifier + */ + private String id; + /* * Name of target database. Note: Target database will be truncated before starting migration. */ @@ -31,7 +37,7 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput /* * Migration settings which tune the migration behavior */ - private Map migrationSetting; + private Map migrationSetting; /* * Source settings to tune source endpoint migration behavior @@ -43,6 +49,11 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput */ private Map targetSetting; + /* + * Tables selected for migration + */ + private List selectedTables; + /** * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput class. */ @@ -69,6 +80,15 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withName(String na return this; } + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + /** * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before * starting migration. @@ -96,7 +116,7 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetDatabase * * @return the migrationSetting value. */ - public Map migrationSetting() { + public Map migrationSetting() { return this.migrationSetting; } @@ -107,7 +127,7 @@ public Map migrationSetting() { * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. */ public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput - withMigrationSetting(Map migrationSetting) { + withMigrationSetting(Map migrationSetting) { this.migrationSetting = migrationSetting; return this; } @@ -152,12 +172,36 @@ 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()); + } } /** @@ -169,9 +213,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName); jsonWriter.writeMapField("migrationSetting", this.migrationSetting, - (writer, element) -> writer.writeString(element)); + (writer, element) -> writer.writeUntyped(element)); jsonWriter.writeMapField("sourceSetting", this.sourceSetting, (writer, element) -> writer.writeString(element)); jsonWriter.writeMapField("targetSetting", this.targetSetting, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("selectedTables", this.selectedTables, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -194,11 +240,13 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput fromJson(Js if ("name".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.id = reader.getString(); } else if ("targetDatabaseName".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.targetDatabaseName = reader.getString(); } else if ("migrationSetting".equals(fieldName)) { - Map migrationSetting = reader.readMap(reader1 -> reader1.getString()); + Map migrationSetting = reader.readMap(reader1 -> reader1.readUntyped()); deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.migrationSetting = migrationSetting; } else if ("sourceSetting".equals(fieldName)) { @@ -207,6 +255,10 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput fromJson(Js } else if ("targetSetting".equals(fieldName)) { Map targetSetting = reader.readMap(reader1 -> reader1.getString()); deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.targetSetting = targetSetting; + } else if ("selectedTables".equals(fieldName)) { + List selectedTables = reader.readArray( + reader1 -> MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.fromJson(reader1)); + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.selectedTables = selectedTables; } else { reader.skipChildren(); } 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 000000000000..5bc281814061 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Selected tables for the migration. + */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + implements JsonSerializable { + /* + * Name of the table to migrate + */ + private String name; + + /** + * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput class. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput. + */ + public static MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput + = new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java index 1f9c542b978e..f53438513462 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java @@ -5,12 +5,14 @@ package com.azure.resourcemanager.datamigration.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -34,6 +36,16 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput */ private PostgreSqlConnectionInfo sourceConnectionInfo; + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + /** * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput class. */ @@ -103,6 +115,36 @@ public PostgreSqlConnectionInfo sourceConnectionInfo() { return this; } + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput + withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + /** * Validates the instance. * @@ -145,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("targetConnectionInfo", this.targetConnectionInfo); jsonWriter.writeJsonField("sourceConnectionInfo", this.sourceConnectionInfo); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); return jsonWriter.writeEndObject(); } @@ -177,6 +220,12 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput fromJson(JsonRe } else if ("sourceConnectionInfo".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.sourceConnectionInfo = PostgreSqlConnectionInfo.fromJson(reader); + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.encryptedKeyForSecureFields + = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java index 7589111b5844..b0b708c00181 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java @@ -4,16 +4,17 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model. */ -@Immutable +@Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { /* @@ -26,6 +27,11 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError */ private ReportableException error; + /* + * List of error events + */ + private List events; + /** * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError class. */ @@ -51,6 +57,27 @@ public ReportableException error() { return this.error; } + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + withEvents(List events) { + this.events = events; + return this; + } + /** * Validates the instance. * @@ -61,6 +88,9 @@ public void validate() { if (error() != null) { error().validate(); } + if (events() != null) { + events().forEach(e -> e.validate()); + } } /** @@ -70,6 +100,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("resultType", this.resultType); + jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -99,6 +130,10 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError fromJson( } else if ("error".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.error = ReportableException.fromJson(reader); + } else if ("events".equals(fieldName)) { + List events + = reader.readArray(reader1 -> SyncMigrationDatabaseErrorEvent.fromJson(reader1)); + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.events = events; } else { reader.skipChildren(); } 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 9dad36975b24..82f4e4f0fe2e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model. */ -@Immutable +@Fluent public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { /* @@ -53,6 +53,26 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationL */ private String targetServer; + /* + * Source server type. + */ + private ScenarioSource sourceServerType; + + /* + * Target server type. + */ + private ScenarioTarget targetServerType; + + /* + * Migration status + */ + private ReplicateMigrationState state; + + /* + * Number of databases to include + */ + private Float databaseCount; + /** * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel class. */ @@ -123,6 +143,53 @@ public String targetServer() { return this.targetServer; } + /** + * Get the sourceServerType property: Source server type. + * + * @return the sourceServerType value. + */ + public ScenarioSource sourceServerType() { + return this.sourceServerType; + } + + /** + * Get the targetServerType property: Target server type. + * + * @return the targetServerType value. + */ + public ScenarioTarget targetServerType() { + return this.targetServerType; + } + + /** + * Get the state property: Migration status. + * + * @return the state value. + */ + public ReplicateMigrationState state() { + return this.state; + } + + /** + * Get the databaseCount property: Number of databases to include. + * + * @return the databaseCount value. + */ + public Float databaseCount() { + return this.databaseCount; + } + + /** + * Set the databaseCount property: Number of databases to include. + * + * @param databaseCount the databaseCount value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel withDatabaseCount(Float databaseCount) { + this.databaseCount = databaseCount; + return this; + } + /** * Validates the instance. * @@ -139,6 +206,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("resultType", this.resultType); + jsonWriter.writeNumberField("databaseCount", this.databaseCount); return jsonWriter.writeEndObject(); } @@ -184,6 +252,18 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel } else if ("targetServer".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.targetServer = reader.getString(); + } else if ("sourceServerType".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.sourceServerType + = ScenarioSource.fromString(reader.getString()); + } else if ("targetServerType".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.targetServerType + = ScenarioTarget.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.state + = ReplicateMigrationState.fromString(reader.getString()); + } else if ("databaseCount".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.databaseCount + = reader.getNullable(JsonReader::getFloat); } else { reader.skipChildren(); } 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 6f383bdb88bf..d55517ef9f1d 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. @@ -20,7 +22,7 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties exten /* * Task type. */ - private String taskType = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync"; + private TaskType taskType = TaskType.MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2; /* * Task input @@ -32,6 +34,21 @@ public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties exten */ private List output; + /* + * task id + */ + private String taskId; + + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + + /* + * whether the task can be cloned or not + */ + private Boolean isCloneable; + /** * Creates an instance of MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties class. */ @@ -44,7 +61,7 @@ public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -78,6 +95,75 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -102,8 +188,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeStringField("createdOn", this.createdOn); + jsonWriter.writeBooleanField("isCloneable", this.isCloneable); return jsonWriter.writeEndObject(); } @@ -131,10 +221,15 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties fromJson(J deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.taskType = reader.getString(); + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.input = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.fromJson(reader); @@ -142,6 +237,13 @@ public static MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties fromJson(J List output = reader .readArray(reader1 -> MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.fromJson(reader1)); deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.output = output; + } else if ("taskId".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.taskId = reader.getString(); + } else if ("createdOn".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.createdOn = reader.getString(); + } else if ("isCloneable".equals(fieldName)) { + deserializedMigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.isCloneable + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } 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 000000000000..6114cf4cfc38 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Database input for migrate schema Sql Server to Azure SQL Server scenario. + */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbDatabaseInput + implements JsonSerializable { + /* + * Name of source database + */ + private String name; + + /* + * Id of the source database + */ + private String id; + + /* + * Name of target database + */ + private String targetDatabaseName; + + /* + * Database schema migration settings + */ + private SchemaMigrationSetting schemaSetting; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbDatabaseInput class. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput() { + } + + /** + * Get the name property: Name of source database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of source database. + * + * @param name the name value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the source database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the source database. + * + * @param id the id value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the schemaSetting property: Database schema migration settings. + * + * @return the schemaSetting value. + */ + public SchemaMigrationSetting schemaSetting() { + return this.schemaSetting; + } + + /** + * Set the schemaSetting property: Database schema migration settings. + * + * @param schemaSetting the schemaSetting value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withSchemaSetting(SchemaMigrationSetting schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schemaSetting() != null) { + schemaSetting().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName); + jsonWriter.writeJsonField("schemaSetting", this.schemaSetting); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbDatabaseInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbDatabaseInput if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbDatabaseInput. + */ + public static MigrateSchemaSqlServerSqlDbDatabaseInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbDatabaseInput deserializedMigrateSchemaSqlServerSqlDbDatabaseInput + = new MigrateSchemaSqlServerSqlDbDatabaseInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbDatabaseInput.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbDatabaseInput.id = reader.getString(); + } else if ("targetDatabaseName".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbDatabaseInput.targetDatabaseName = reader.getString(); + } else if ("schemaSetting".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbDatabaseInput.schemaSetting + = SchemaMigrationSetting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbDatabaseInput; + }); + } +} 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 000000000000..363d5e0d951b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Input for task that migrates Schema for SQL Server databases to Azure SQL databases. + */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + /* + * Databases to migrate + */ + private List selectedDatabases; + + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + + /* + * Migration start time + */ + private String startedOn; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskInput class. + */ + public MigrateSchemaSqlServerSqlDbTaskInput() { + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput + withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Migration start time. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (selectedDatabases() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSchemaSqlServerSqlDbTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (sourceConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model MigrateSchemaSqlServerSqlDbTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetConnectionInfo in model MigrateSchemaSqlServerSqlDbTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceConnectionInfo", sourceConnectionInfo()); + jsonWriter.writeJsonField("targetConnectionInfo", targetConnectionInfo()); + jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); + jsonWriter.writeStringField("startedOn", this.startedOn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskInput if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskInput. + */ + public static MigrateSchemaSqlServerSqlDbTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskInput deserializedMigrateSchemaSqlServerSqlDbTaskInput + = new MigrateSchemaSqlServerSqlDbTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceConnectionInfo".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskInput + .withSourceConnectionInfo(SqlConnectionInfo.fromJson(reader)); + } else if ("targetConnectionInfo".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskInput + .withTargetConnectionInfo(SqlConnectionInfo.fromJson(reader)); + } else if ("selectedDatabases".equals(fieldName)) { + List selectedDatabases + = reader.readArray(reader1 -> MigrateSchemaSqlServerSqlDbDatabaseInput.fromJson(reader1)); + deserializedMigrateSchemaSqlServerSqlDbTaskInput.selectedDatabases = selectedDatabases; + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskInput.encryptedKeyForSecureFields = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskInput.startedOn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskInput; + }); + } +} 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 000000000000..f5dbaedd811b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output for the task that migrates Schema for SQL Server databases to Azure SQL databases. + */ +@Immutable +public class MigrateSchemaSqlServerSqlDbTaskOutput implements JsonSerializable { + /* + * Result type + */ + private String resultType = "MigrateSchemaSqlServerSqlDbTaskOutput"; + + /* + * Result identifier + */ + private String id; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskOutput class. + */ + public MigrateSchemaSqlServerSqlDbTaskOutput() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + public String resultType() { + return this.resultType; + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Result identifier. + * + * @param id the id value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskOutput object itself. + */ + MigrateSchemaSqlServerSqlDbTaskOutput withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskOutput if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskOutput. + */ + public static MigrateSchemaSqlServerSqlDbTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resultType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("MigrationLevelOutput".equals(discriminatorValue)) { + return MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.fromJson(readerToUse.reset()); + } else if ("DatabaseLevelOutput".equals(discriminatorValue)) { + return MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.fromJson(readerToUse.reset()); + } else if ("SchemaErrorOutput".equals(discriminatorValue)) { + return MigrateSchemaSqlServerSqlDbTaskOutputError.fromJson(readerToUse.reset()); + } else if ("ErrorOutput".equals(discriminatorValue)) { + return MigrateSchemaSqlTaskOutputError.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MigrateSchemaSqlServerSqlDbTaskOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskOutput deserializedMigrateSchemaSqlServerSqlDbTaskOutput + = new MigrateSchemaSqlServerSqlDbTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultType".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutput.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutput.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskOutput; + }); + } +} 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 000000000000..4b63c1a270da --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel model. + */ +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Result type + */ + private String resultType = "DatabaseLevelOutput"; + + /* + * The name of the database + */ + private String databaseName; + + /* + * State of the schema migration for this database + */ + private MigrationState state; + + /* + * Schema migration stage for this database + */ + private SchemaMigrationStage stage; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Prefix string to use for querying errors for this database + */ + private String databaseErrorResultPrefix; + + /* + * Prefix string to use for querying schema errors for this database + */ + private String schemaErrorResultPrefix; + + /* + * Number of successful operations for this database + */ + private Long numberOfSuccessfulOperations; + + /* + * Number of failed operations for this database + */ + private Long numberOfFailedOperations; + + /* + * Identifier for the file resource containing the schema of this database + */ + private String fileId; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel class. + */ + public MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel. + */ + public static MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel + = new MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.resultType = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.databaseName = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.state + = MigrationState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.stage + = SchemaMigrationStage.fromString(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("databaseErrorResultPrefix".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.databaseErrorResultPrefix + = reader.getString(); + } else if ("schemaErrorResultPrefix".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.schemaErrorResultPrefix + = reader.getString(); + } else if ("numberOfSuccessfulOperations".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.numberOfSuccessfulOperations + = reader.getNullable(JsonReader::getLong); + } else if ("numberOfFailedOperations".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.numberOfFailedOperations + = reader.getNullable(JsonReader::getLong); + } else if ("fileId".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.fileId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel; + }); + } +} 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 000000000000..eaeaaa44f534 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputError model. + */ +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Result type + */ + private String resultType = "SchemaErrorOutput"; + + /* + * Schema command which failed + */ + private String commandText; + + /* + * Reason of failure + */ + private String errorText; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskOutputError class. + */ + public MigrateSchemaSqlServerSqlDbTaskOutputError() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskOutputError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskOutputError if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskOutputError. + */ + public static MigrateSchemaSqlServerSqlDbTaskOutputError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskOutputError deserializedMigrateSchemaSqlServerSqlDbTaskOutputError + = new MigrateSchemaSqlServerSqlDbTaskOutputError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputError.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputError.resultType = reader.getString(); + } else if ("commandText".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputError.commandText = reader.getString(); + } else if ("errorText".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputError.errorText = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskOutputError; + }); + } +} 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 000000000000..36d6a27b7bab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel model. + */ +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Result type + */ + private String resultType = "MigrationLevelOutput"; + + /* + * Overall state of the schema migration + */ + private MigrationState state; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Source server version + */ + private String sourceServerVersion; + + /* + * Source server brand version + */ + private String sourceServerBrandVersion; + + /* + * Target server version + */ + private String targetServerVersion; + + /* + * Target server brand version + */ + private String targetServerBrandVersion; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel class. + */ + public MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel. + */ + public static MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel + = new MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.resultType = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.state + = MigrationState.fromString(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sourceServerVersion".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.sourceServerVersion + = reader.getString(); + } else if ("sourceServerBrandVersion".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.sourceServerBrandVersion + = reader.getString(); + } else if ("targetServerVersion".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.targetServerVersion + = reader.getString(); + } else if ("targetServerBrandVersion".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.targetServerBrandVersion + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel; + }); + } +} 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 000000000000..3e5a79fcc724 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for task that migrates Schema for SQL Server databases to Azure SQL databases. + */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.MIGRATE_SCHEMA_SQL_SERVER_SQL_DB; + + /* + * Task input + */ + private MigrateSchemaSqlServerSqlDbTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + + /* + * Task id + */ + private String taskId; + + /* + * whether the task can be cloned or not + */ + private Boolean isCloneable; + + /** + * Creates an instance of MigrateSchemaSqlServerSqlDbTaskProperties class. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSchemaSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withInput(MigrateSchemaSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the taskId property: Task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSchemaSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("createdOn", this.createdOn); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeBooleanField("isCloneable", this.isCloneable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlServerSqlDbTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlServerSqlDbTaskProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlServerSqlDbTaskProperties. + */ + public static MigrateSchemaSqlServerSqlDbTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlServerSqlDbTaskProperties deserializedMigrateSchemaSqlServerSqlDbTaskProperties + = new MigrateSchemaSqlServerSqlDbTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.input + = MigrateSchemaSqlServerSqlDbTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> MigrateSchemaSqlServerSqlDbTaskOutput.fromJson(reader1)); + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.output = output; + } else if ("createdOn".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.createdOn = reader.getString(); + } else if ("taskId".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.taskId = reader.getString(); + } else if ("isCloneable".equals(fieldName)) { + deserializedMigrateSchemaSqlServerSqlDbTaskProperties.isCloneable + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlServerSqlDbTaskProperties; + }); + } +} 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 000000000000..4eb504f81913 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MigrateSchemaSqlTaskOutputError model. + */ +@Immutable +public final class MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + /* + * Result type + */ + private String resultType = "ErrorOutput"; + + /* + * Migration error + */ + private ReportableException error; + + /** + * Creates an instance of MigrateSchemaSqlTaskOutputError class. + */ + public MigrateSchemaSqlTaskOutputError() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (error() != null) { + error().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSchemaSqlTaskOutputError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSchemaSqlTaskOutputError if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSchemaSqlTaskOutputError. + */ + public static MigrateSchemaSqlTaskOutputError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSchemaSqlTaskOutputError deserializedMigrateSchemaSqlTaskOutputError + = new MigrateSchemaSqlTaskOutputError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSchemaSqlTaskOutputError.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSchemaSqlTaskOutputError.resultType = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedMigrateSchemaSqlTaskOutputError.error = ReportableException.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSchemaSqlTaskOutputError; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java index 1ebc8983abdf..593ee6d6777c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java @@ -37,6 +37,16 @@ public final class MigrateSqlServerSqlDbDatabaseInput implements JsonSerializabl */ private Map tableMap; + /* + * Settings selected for DB schema migration. + */ + private Object schemaSetting; + + /* + * id of the database + */ + private String id; + /** * Creates an instance of MigrateSqlServerSqlDbDatabaseInput class. */ @@ -125,6 +135,46 @@ public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map table return this; } + /** + * Get the schemaSetting property: Settings selected for DB schema migration. + * + * @return the schemaSetting value. + */ + public Object schemaSetting() { + return this.schemaSetting; + } + + /** + * Set the schemaSetting property: Settings selected for DB schema migration. + * + * @param schemaSetting the schemaSetting value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withSchemaSetting(Object schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + + /** + * Get the id property: id of the database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: id of the database. + * + * @param id the id value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withId(String id) { + this.id = id; + return this; + } + /** * Validates the instance. * @@ -143,6 +193,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName); jsonWriter.writeBooleanField("makeSourceDbReadOnly", this.makeSourceDbReadOnly); jsonWriter.writeMapField("tableMap", this.tableMap, (writer, element) -> writer.writeString(element)); + jsonWriter.writeUntypedField("schemaSetting", this.schemaSetting); + jsonWriter.writeStringField("id", this.id); return jsonWriter.writeEndObject(); } @@ -172,6 +224,10 @@ public static MigrateSqlServerSqlDbDatabaseInput fromJson(JsonReader jsonReader) } else if ("tableMap".equals(fieldName)) { Map tableMap = reader.readMap(reader1 -> reader1.getString()); deserializedMigrateSqlServerSqlDbDatabaseInput.tableMap = tableMap; + } else if ("schemaSetting".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbDatabaseInput.schemaSetting = reader.readUntyped(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbDatabaseInput.id = reader.getString(); } else { reader.skipChildren(); } 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 d203a4688a3f..b06f3b7b09b0 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; 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. @@ -20,7 +22,7 @@ public final class MigrateSqlServerSqlDbSyncTaskProperties extends ProjectTaskPr /* * Task type. */ - private String taskType = "Migrate.SqlServer.AzureSqlDb.Sync"; + private TaskType taskType = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC; /* * Task input @@ -44,7 +46,7 @@ public MigrateSqlServerSqlDbSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +79,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public MigrateSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,7 +112,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -129,10 +141,15 @@ public static MigrateSqlServerSqlDbSyncTaskProperties fromJson(JsonReader jsonRe deserializedMigrateSqlServerSqlDbSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigrateSqlServerSqlDbSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSqlServerSqlDbSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigrateSqlServerSqlDbSyncTaskProperties.taskType = reader.getString(); + deserializedMigrateSqlServerSqlDbSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateSqlServerSqlDbSyncTaskProperties.input = MigrateSqlServerSqlDbSyncTaskInput.fromJson(reader); diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java index f77da549ce1d..8dcd2d660d2f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java @@ -33,6 +33,16 @@ public final class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput */ private MigrationValidationOptions validationOptions; + /* + * Date and time relative to UTC when the migration was started on + */ + private String startedOn; + + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + /** * Creates an instance of MigrateSqlServerSqlDbTaskInput class. */ @@ -92,6 +102,46 @@ public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationO return this; } + /** + * Get the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * {@inheritDoc} */ @@ -156,6 +206,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("validationOptions", this.validationOptions); + jsonWriter.writeStringField("startedOn", this.startedOn); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); return jsonWriter.writeEndObject(); } @@ -189,6 +241,10 @@ public static MigrateSqlServerSqlDbTaskInput fromJson(JsonReader jsonReader) thr } else if ("validationOptions".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskInput.validationOptions = MigrationValidationOptions.fromJson(reader); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskInput.startedOn = reader.getString(); + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskInput.encryptedKeyForSecureFields = reader.getString(); } else { reader.skipChildren(); } 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 d3ea0611fd40..1a5e3f34c4eb 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 @@ -14,7 +14,7 @@ import java.util.List; /** - * Database level result for Sql Server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputDatabaseLevel model. */ @Immutable public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java index 955baeccdce7..0285fcec1709 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.java @@ -13,7 +13,7 @@ import java.time.OffsetDateTime; /** - * Database validation result for Sql Server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult model. */ @Immutable public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult @@ -23,6 +23,11 @@ public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult */ private String resultType = "MigrationDatabaseLevelValidationOutput"; + /* + * Result identifier + */ + private String id; + /* * Migration Identifier */ @@ -84,6 +89,16 @@ public String resultType() { return this.resultType; } + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the migrationId property: Migration Identifier. * @@ -213,11 +228,11 @@ public static MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult fromJ String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { - deserializedMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.withId(reader.getString()); - } else if ("resultType".equals(fieldName)) { + if ("resultType".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.id = reader.getString(); } else if ("migrationId".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.migrationId = reader.getString(); 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 1e750d17532a..2f4c6a42a80a 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 java.io.IOException; /** - * Task errors for Sql Server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputError model. */ @Immutable public final class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { 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 b526d36312dd..d83b55adccaa 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.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,9 +14,9 @@ import java.util.List; /** - * Migration level result for Sql server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputMigrationLevel model. */ -@Immutable +@Fluent public final class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { /* * Result type @@ -63,10 +63,15 @@ public final class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends Migrate */ private String databaseSummary; + /* + * Migration Validation Results + */ + private MigrationValidationResult migrationValidationResult; + /* * Migration Report Result, provides unique url for downloading your migration report. */ - private MigrationReportResult migrationReport; + private MigrationReportResult migrationReportResult; /* * Source server version @@ -182,13 +187,47 @@ public String databaseSummary() { } /** - * Get the migrationReport property: Migration Report Result, provides unique url for downloading your migration - * report. + * Get the migrationValidationResult property: Migration Validation Results. + * + * @return the migrationValidationResult value. + */ + public MigrationValidationResult migrationValidationResult() { + return this.migrationValidationResult; + } + + /** + * Set the migrationValidationResult property: Migration Validation Results. * - * @return the migrationReport value. + * @param migrationValidationResult the migrationValidationResult value to set. + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. */ - public MigrationReportResult migrationReport() { - return this.migrationReport; + 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; } /** @@ -243,8 +282,11 @@ public List exceptionsAndWarnings() { */ @Override public void validate() { - if (migrationReport() != null) { - migrationReport().validate(); + if (migrationValidationResult() != null) { + migrationValidationResult().validate(); + } + if (migrationReportResult() != null) { + migrationReportResult().validate(); } if (exceptionsAndWarnings() != null) { exceptionsAndWarnings().forEach(e -> e.validate()); @@ -258,6 +300,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("resultType", this.resultType); + jsonWriter.writeJsonField("migrationValidationResult", this.migrationValidationResult); + jsonWriter.writeJsonField("migrationReportResult", this.migrationReportResult); return jsonWriter.writeEndObject(); } @@ -301,8 +345,11 @@ public static MigrateSqlServerSqlDbTaskOutputMigrationLevel fromJson(JsonReader deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.databases = reader.getString(); } else if ("databaseSummary".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.databaseSummary = reader.getString(); - } else if ("migrationReport".equals(fieldName)) { - deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.migrationReport + } else if ("migrationValidationResult".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.migrationValidationResult + = MigrationValidationResult.fromJson(reader); + } else if ("migrationReportResult".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.migrationReportResult = MigrationReportResult.fromJson(reader); } else if ("sourceServerVersion".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputMigrationLevel.sourceServerVersion = reader.getString(); 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 7b212065cc5b..74b83703b89e 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 @@ -13,7 +13,7 @@ import java.time.OffsetDateTime; /** - * Table level result for Sql Server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputTableLevel model. */ @Immutable public final class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java index fc19acb63a2f..80488416dec4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputValidationResult.java @@ -12,7 +12,7 @@ import java.util.Map; /** - * Validation result for Sql Server to Azure Sql DB migration. + * The MigrateSqlServerSqlDbTaskOutputValidationResult model. */ @Fluent public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends MigrateSqlServerSqlDbTaskOutput { @@ -21,6 +21,11 @@ public final class MigrateSqlServerSqlDbTaskOutputValidationResult extends Migra */ private String resultType = "MigrationValidationOutput"; + /* + * Migration validation result identifier + */ + private String id; + /* * Migration Identifier */ @@ -53,6 +58,16 @@ public String resultType() { return this.resultType; } + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the migrationId property: Migration Identifier. * @@ -136,10 +151,10 @@ public static MigrateSqlServerSqlDbTaskOutputValidationResult fromJson(JsonReade String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { - deserializedMigrateSqlServerSqlDbTaskOutputValidationResult.withId(reader.getString()); - } else if ("resultType".equals(fieldName)) { + if ("resultType".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputValidationResult.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskOutputValidationResult.id = reader.getString(); } else if ("migrationId".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskOutputValidationResult.migrationId = reader.getString(); } else if ("summaryResults".equals(fieldName)) { 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 7ac2836dc254..a1857bc40409 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database. @@ -20,7 +22,7 @@ public final class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProper /* * Task type. */ - private String taskType = "Migrate.SqlServer.SqlDb"; + private TaskType taskType = TaskType.MIGRATE_SQL_SERVER_SQL_DB; /* * Task input @@ -32,6 +34,21 @@ public final class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProper */ private List output; + /* + * task id + */ + private String taskId; + + /* + * whether the task can be cloned or not + */ + private Boolean isCloneable; + + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + /** * Creates an instance of MigrateSqlServerSqlDbTaskProperties class. */ @@ -44,7 +61,7 @@ public MigrateSqlServerSqlDbTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +94,75 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +187,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeBooleanField("isCloneable", this.isCloneable); + jsonWriter.writeStringField("createdOn", this.createdOn); return jsonWriter.writeEndObject(); } @@ -128,10 +218,14 @@ public static MigrateSqlServerSqlDbTaskProperties fromJson(JsonReader jsonReader } else if ("state".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigrateSqlServerSqlDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSqlServerSqlDbTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigrateSqlServerSqlDbTaskProperties.taskType = reader.getString(); + deserializedMigrateSqlServerSqlDbTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateSqlServerSqlDbTaskProperties.input = MigrateSqlServerSqlDbTaskInput.fromJson(reader); @@ -139,6 +233,13 @@ public static MigrateSqlServerSqlDbTaskProperties fromJson(JsonReader jsonReader List output = reader.readArray(reader1 -> MigrateSqlServerSqlDbTaskOutput.fromJson(reader1)); deserializedMigrateSqlServerSqlDbTaskProperties.output = output; + } else if ("taskId".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskProperties.taskId = reader.getString(); + } else if ("isCloneable".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskProperties.isCloneable + = reader.getNullable(JsonReader::getBoolean); + } else if ("createdOn".equals(fieldName)) { + deserializedMigrateSqlServerSqlDbTaskProperties.createdOn = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java index dd3481b4c472..3b4845fe93aa 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java @@ -38,6 +38,11 @@ public final class MigrateSqlServerSqlMIDatabaseInput implements JsonSerializabl */ private List backupFilePaths; + /* + * id of the database + */ + private String id; + /** * Creates an instance of MigrateSqlServerSqlMIDatabaseInput class. */ @@ -124,6 +129,26 @@ public MigrateSqlServerSqlMIDatabaseInput withBackupFilePaths(List backu return this; } + /** + * Get the id property: id of the database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: id of the database. + * + * @param id the id value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withId(String id) { + this.id = id; + return this; + } + /** * Validates the instance. * @@ -158,6 +183,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("backupFileShare", this.backupFileShare); jsonWriter.writeArrayField("backupFilePaths", this.backupFilePaths, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); return jsonWriter.writeEndObject(); } @@ -187,6 +213,8 @@ public static MigrateSqlServerSqlMIDatabaseInput fromJson(JsonReader jsonReader) } else if ("backupFilePaths".equals(fieldName)) { List backupFilePaths = reader.readArray(reader1 -> reader1.getString()); deserializedMigrateSqlServerSqlMIDatabaseInput.backupFilePaths = backupFilePaths; + } else if ("id".equals(fieldName)) { + deserializedMigrateSqlServerSqlMIDatabaseInput.id = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java index dd6d6d19ff89..fc50b02ac044 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java @@ -17,12 +17,38 @@ */ @Fluent public final class MigrateSqlServerSqlMISyncTaskInput extends SqlServerSqlMISyncTaskInput { + /* + * Number of database migrations to start in parallel + */ + private Float numberOfParallelDatabaseMigrations; + /** * Creates an instance of MigrateSqlServerSqlMISyncTaskInput class. */ public MigrateSqlServerSqlMISyncTaskInput() { } + /** + * Get the numberOfParallelDatabaseMigrations property: Number of database migrations to start in parallel. + * + * @return the numberOfParallelDatabaseMigrations value. + */ + public Float numberOfParallelDatabaseMigrations() { + return this.numberOfParallelDatabaseMigrations; + } + + /** + * Set the numberOfParallelDatabaseMigrations property: Number of database migrations to start in parallel. + * + * @param numberOfParallelDatabaseMigrations the numberOfParallelDatabaseMigrations value to set. + * @return the MigrateSqlServerSqlMISyncTaskInput object itself. + */ + public MigrateSqlServerSqlMISyncTaskInput + withNumberOfParallelDatabaseMigrations(Float numberOfParallelDatabaseMigrations) { + this.numberOfParallelDatabaseMigrations = numberOfParallelDatabaseMigrations; + return this; + } + /** * {@inheritDoc} */ @@ -138,6 +164,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("targetConnectionInfo", targetConnectionInfo()); jsonWriter.writeJsonField("azureApp", azureApp()); jsonWriter.writeJsonField("backupFileShare", backupFileShare()); + jsonWriter.writeNumberField("numberOfParallelDatabaseMigrations", this.numberOfParallelDatabaseMigrations); return jsonWriter.writeEndObject(); } @@ -175,6 +202,9 @@ public static MigrateSqlServerSqlMISyncTaskInput fromJson(JsonReader jsonReader) .withAzureApp(AzureActiveDirectoryApp.fromJson(reader)); } else if ("backupFileShare".equals(fieldName)) { deserializedMigrateSqlServerSqlMISyncTaskInput.withBackupFileShare(FileShare.fromJson(reader)); + } else if ("numberOfParallelDatabaseMigrations".equals(fieldName)) { + deserializedMigrateSqlServerSqlMISyncTaskInput.numberOfParallelDatabaseMigrations + = reader.getNullable(JsonReader::getFloat); } else { reader.skipChildren(); } 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 497a3200e608..be100081e2a3 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario. @@ -20,7 +22,7 @@ public final class MigrateSqlServerSqlMISyncTaskProperties extends ProjectTaskPr /* * Task type. */ - private String taskType = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"; + private TaskType taskType = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS; /* * Task input @@ -32,6 +34,11 @@ public final class MigrateSqlServerSqlMISyncTaskProperties extends ProjectTaskPr */ private List output; + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + /** * Creates an instance of MigrateSqlServerSqlMISyncTaskProperties class. */ @@ -44,7 +51,7 @@ public MigrateSqlServerSqlMISyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +84,35 @@ public List output() { return this.output; } + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlMISyncTaskProperties object itself. + */ + public MigrateSqlServerSqlMISyncTaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +137,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("createdOn", this.createdOn); return jsonWriter.writeEndObject(); } @@ -129,10 +167,15 @@ public static MigrateSqlServerSqlMISyncTaskProperties fromJson(JsonReader jsonRe deserializedMigrateSqlServerSqlMISyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigrateSqlServerSqlMISyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSqlServerSqlMISyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigrateSqlServerSqlMISyncTaskProperties.taskType = reader.getString(); + deserializedMigrateSqlServerSqlMISyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateSqlServerSqlMISyncTaskProperties.input = MigrateSqlServerSqlMISyncTaskInput.fromJson(reader); @@ -140,6 +183,8 @@ public static MigrateSqlServerSqlMISyncTaskProperties fromJson(JsonReader jsonRe List output = reader.readArray(reader1 -> MigrateSqlServerSqlMISyncTaskOutput.fromJson(reader1)); deserializedMigrateSqlServerSqlMISyncTaskProperties.output = output; + } else if ("createdOn".equals(fieldName)) { + deserializedMigrateSqlServerSqlMISyncTaskProperties.createdOn = reader.getString(); } else { reader.skipChildren(); } 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 a00d0863397a..0e19884b1433 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 @@ -22,6 +22,11 @@ public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput */ private List selectedDatabases; + /* + * Date and time relative to UTC when the migration was started on + */ + private String startedOn; + /* * Logins to migrate. */ @@ -48,6 +53,17 @@ public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput */ 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 + */ + private String aadDomainName; + + /* + * encrypted key for secure fields + */ + private String encryptedKeyForSecureFields; + /** * Creates an instance of MigrateSqlServerSqlMITaskInput class. */ @@ -75,6 +91,26 @@ public List selectedDatabases() { return this; } + /** + * Get the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @return the startedOn value. + */ + public String startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Date and time relative to UTC when the migration was started on. + * + * @param startedOn the startedOn value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withStartedOn(String startedOn) { + this.startedOn = startedOn; + return this; + } + /** * Get the selectedLogins property: Logins to migrate. * @@ -177,6 +213,48 @@ public MigrateSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { return this; } + /** + * Get the aadDomainName property: Azure Active Directory domain name in the format of 'contoso.com' for federated + * Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected. + * + * @return the aadDomainName value. + */ + public String aadDomainName() { + return this.aadDomainName; + } + + /** + * Set the aadDomainName property: Azure Active Directory domain name in the format of 'contoso.com' for federated + * Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected. + * + * @param aadDomainName the aadDomainName value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withAadDomainName(String aadDomainName) { + this.aadDomainName = aadDomainName; + return this; + } + + /** + * Get the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @return the encryptedKeyForSecureFields value. + */ + public String encryptedKeyForSecureFields() { + return this.encryptedKeyForSecureFields; + } + + /** + * Set the encryptedKeyForSecureFields property: encrypted key for secure fields. + * + * @param encryptedKeyForSecureFields the encryptedKeyForSecureFields value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withEncryptedKeyForSecureFields(String encryptedKeyForSecureFields) { + this.encryptedKeyForSecureFields = encryptedKeyForSecureFields; + return this; + } + /** * {@inheritDoc} */ @@ -248,12 +326,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("selectedDatabases", this.selectedDatabases, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("backupBlobShare", this.backupBlobShare); + jsonWriter.writeStringField("startedOn", this.startedOn); jsonWriter.writeArrayField("selectedLogins", this.selectedLogins, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("selectedAgentJobs", this.selectedAgentJobs, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("backupFileShare", this.backupFileShare); jsonWriter.writeStringField("backupMode", this.backupMode == null ? null : this.backupMode.toString()); + jsonWriter.writeStringField("aadDomainName", this.aadDomainName); + jsonWriter.writeStringField("encryptedKeyForSecureFields", this.encryptedKeyForSecureFields); return jsonWriter.writeEndObject(); } @@ -286,6 +367,8 @@ public static MigrateSqlServerSqlMITaskInput fromJson(JsonReader jsonReader) thr deserializedMigrateSqlServerSqlMITaskInput.selectedDatabases = selectedDatabases; } else if ("backupBlobShare".equals(fieldName)) { deserializedMigrateSqlServerSqlMITaskInput.backupBlobShare = BlobShare.fromJson(reader); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskInput.startedOn = reader.getString(); } else if ("selectedLogins".equals(fieldName)) { List selectedLogins = reader.readArray(reader1 -> reader1.getString()); deserializedMigrateSqlServerSqlMITaskInput.selectedLogins = selectedLogins; @@ -296,6 +379,10 @@ public static MigrateSqlServerSqlMITaskInput fromJson(JsonReader jsonReader) thr deserializedMigrateSqlServerSqlMITaskInput.backupFileShare = FileShare.fromJson(reader); } else if ("backupMode".equals(fieldName)) { deserializedMigrateSqlServerSqlMITaskInput.backupMode = BackupMode.fromString(reader.getString()); + } else if ("aadDomainName".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskInput.aadDomainName = reader.getString(); + } else if ("encryptedKeyForSecureFields".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskInput.encryptedKeyForSecureFields = reader.getString(); } else { reader.skipChildren(); } 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 264f818a91ce..5cde14a0316a 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance. @@ -20,7 +22,7 @@ public final class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProper /* * Task type. */ - private String taskType = "Migrate.SqlServer.AzureSqlDbMI"; + private TaskType taskType = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI; /* * Task input @@ -32,6 +34,26 @@ public final class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProper */ private List output; + /* + * task id + */ + private String taskId; + + /* + * DateTime in UTC when the task was created + */ + private String createdOn; + + /* + * parent task id + */ + private String parentTaskId; + + /* + * whether the task can be cloned or not + */ + private Boolean isCloneable; + /** * Creates an instance of MigrateSqlServerSqlMITaskProperties class. */ @@ -44,7 +66,7 @@ public MigrateSqlServerSqlMITaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -77,6 +99,95 @@ public List output() { return this.output; } + /** + * Get the taskId property: task id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: task id. + * + * @param taskId the taskId value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the createdOn property: DateTime in UTC when the task was created. + * + * @return the createdOn value. + */ + public String createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime in UTC when the task was created. + * + * @param createdOn the createdOn value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withCreatedOn(String createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the parentTaskId property: parent task id. + * + * @return the parentTaskId value. + */ + public String parentTaskId() { + return this.parentTaskId; + } + + /** + * Set the parentTaskId property: parent task id. + * + * @param parentTaskId the parentTaskId value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withParentTaskId(String parentTaskId) { + this.parentTaskId = parentTaskId; + return this; + } + + /** + * Get the isCloneable property: whether the task can be cloned or not. + * + * @return the isCloneable value. + */ + public Boolean isCloneable() { + return this.isCloneable; + } + + /** + * Set the isCloneable property: whether the task can be cloned or not. + * + * @param isCloneable the isCloneable value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withIsCloneable(Boolean isCloneable) { + this.isCloneable = isCloneable; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MigrateSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -101,8 +212,13 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeStringField("createdOn", this.createdOn); + jsonWriter.writeStringField("parentTaskId", this.parentTaskId); + jsonWriter.writeBooleanField("isCloneable", this.isCloneable); return jsonWriter.writeEndObject(); } @@ -128,10 +244,14 @@ public static MigrateSqlServerSqlMITaskProperties fromJson(JsonReader jsonReader } else if ("state".equals(fieldName)) { deserializedMigrateSqlServerSqlMITaskProperties.withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedMigrateSqlServerSqlMITaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSqlServerSqlMITaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedMigrateSqlServerSqlMITaskProperties.taskType = reader.getString(); + deserializedMigrateSqlServerSqlMITaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateSqlServerSqlMITaskProperties.input = MigrateSqlServerSqlMITaskInput.fromJson(reader); @@ -139,6 +259,15 @@ public static MigrateSqlServerSqlMITaskProperties fromJson(JsonReader jsonReader List output = reader.readArray(reader1 -> MigrateSqlServerSqlMITaskOutput.fromJson(reader1)); deserializedMigrateSqlServerSqlMITaskProperties.output = output; + } else if ("taskId".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskProperties.taskId = reader.getString(); + } else if ("createdOn".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskProperties.createdOn = reader.getString(); + } else if ("parentTaskId".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskProperties.parentTaskId = reader.getString(); + } else if ("isCloneable".equals(fieldName)) { + deserializedMigrateSqlServerSqlMITaskProperties.isCloneable + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } 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 000000000000..5e2caa5847f5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + */ +@Fluent +public final class MigrateSsisTaskInput extends SqlMigrationTaskInput { + /* + * SSIS package migration information. + */ + private SsisMigrationInfo ssisMigrationInfo; + + /** + * Creates an instance of MigrateSsisTaskInput class. + */ + public MigrateSsisTaskInput() { + } + + /** + * 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() { + if (ssisMigrationInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ssisMigrationInfo in model MigrateSsisTaskInput")); + } else { + ssisMigrationInfo().validate(); + } + if (sourceConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model MigrateSsisTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetConnectionInfo in model MigrateSsisTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MigrateSsisTaskInput.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceConnectionInfo", sourceConnectionInfo()); + jsonWriter.writeJsonField("targetConnectionInfo", targetConnectionInfo()); + jsonWriter.writeJsonField("ssisMigrationInfo", this.ssisMigrationInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSsisTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSsisTaskInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MigrateSsisTaskInput. + */ + public static MigrateSsisTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSsisTaskInput deserializedMigrateSsisTaskInput = new MigrateSsisTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceConnectionInfo".equals(fieldName)) { + deserializedMigrateSsisTaskInput.withSourceConnectionInfo(SqlConnectionInfo.fromJson(reader)); + } else if ("targetConnectionInfo".equals(fieldName)) { + deserializedMigrateSsisTaskInput.withTargetConnectionInfo(SqlConnectionInfo.fromJson(reader)); + } else if ("ssisMigrationInfo".equals(fieldName)) { + deserializedMigrateSsisTaskInput.ssisMigrationInfo = SsisMigrationInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSsisTaskInput; + }); + } +} 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 000000000000..ebe0d412a8d0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. + */ +@Immutable +public class MigrateSsisTaskOutput implements JsonSerializable { + /* + * Result type + */ + private String resultType = "MigrateSsisTaskOutput"; + + /* + * Result identifier + */ + private String id; + + /** + * Creates an instance of MigrateSsisTaskOutput class. + */ + public MigrateSsisTaskOutput() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + public String resultType() { + return this.resultType; + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Result identifier. + * + * @param id the id value to set. + * @return the MigrateSsisTaskOutput object itself. + */ + MigrateSsisTaskOutput withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSsisTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSsisTaskOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSsisTaskOutput. + */ + public static MigrateSsisTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resultType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("MigrationLevelOutput".equals(discriminatorValue)) { + return MigrateSsisTaskOutputMigrationLevel.fromJson(readerToUse.reset()); + } else if ("SsisProjectLevelOutput".equals(discriminatorValue)) { + return MigrateSsisTaskOutputProjectLevel.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MigrateSsisTaskOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSsisTaskOutput deserializedMigrateSsisTaskOutput = new MigrateSsisTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultType".equals(fieldName)) { + deserializedMigrateSsisTaskOutput.resultType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMigrateSsisTaskOutput.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSsisTaskOutput; + }); + } +} 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 000000000000..74c8a8b1cf3d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The MigrateSsisTaskOutputMigrationLevel model. + */ +@Immutable +public final class MigrateSsisTaskOutputMigrationLevel extends MigrateSsisTaskOutput { + /* + * Result type + */ + private String resultType = "MigrationLevelOutput"; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Current status of migration + */ + private MigrationStatus status; + + /* + * Migration progress message + */ + private String message; + + /* + * Source server version + */ + private String sourceServerVersion; + + /* + * Source server brand version + */ + private String sourceServerBrandVersion; + + /* + * Target server version + */ + private String targetServerVersion; + + /* + * Target server brand version + */ + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + private List exceptionsAndWarnings; + + /* + * Stage of SSIS migration. + */ + private SsisMigrationStage stage; + + /** + * Creates an instance of MigrateSsisTaskOutputMigrationLevel class. + */ + public MigrateSsisTaskOutputMigrationLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSsisTaskOutputMigrationLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSsisTaskOutputMigrationLevel if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSsisTaskOutputMigrationLevel. + */ + public static MigrateSsisTaskOutputMigrationLevel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSsisTaskOutputMigrationLevel deserializedMigrateSsisTaskOutputMigrationLevel + = new MigrateSsisTaskOutputMigrationLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.resultType = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.status + = MigrationStatus.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.message = reader.getString(); + } else if ("sourceServerVersion".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.sourceServerVersion = reader.getString(); + } else if ("sourceServerBrandVersion".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.sourceServerBrandVersion = reader.getString(); + } else if ("targetServerVersion".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.targetServerVersion = reader.getString(); + } else if ("targetServerBrandVersion".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.targetServerBrandVersion = reader.getString(); + } else if ("exceptionsAndWarnings".equals(fieldName)) { + List exceptionsAndWarnings + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedMigrateSsisTaskOutputMigrationLevel.exceptionsAndWarnings = exceptionsAndWarnings; + } else if ("stage".equals(fieldName)) { + deserializedMigrateSsisTaskOutputMigrationLevel.stage + = SsisMigrationStage.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSsisTaskOutputMigrationLevel; + }); + } +} 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 000000000000..f3d3418c587d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The MigrateSsisTaskOutputProjectLevel model. + */ +@Immutable +public final class MigrateSsisTaskOutputProjectLevel extends MigrateSsisTaskOutput { + /* + * Result type + */ + private String resultType = "SsisProjectLevelOutput"; + + /* + * Name of the folder + */ + private String folderName; + + /* + * Name of the project + */ + private String projectName; + + /* + * Current state of migration + */ + private MigrationState state; + + /* + * Stage of SSIS migration. + */ + private SsisMigrationStage stage; + + /* + * Migration start time + */ + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + private OffsetDateTime endedOn; + + /* + * Migration progress message + */ + private String message; + + /* + * Migration exceptions and warnings + */ + private List exceptionsAndWarnings; + + /** + * Creates an instance of MigrateSsisTaskOutputProjectLevel class. + */ + public MigrateSsisTaskOutputProjectLevel() { + } + + /** + * Get the resultType property: Result type. + * + * @return the resultType value. + */ + @Override + public String resultType() { + return this.resultType; + } + + /** + * 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() { + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resultType", this.resultType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSsisTaskOutputProjectLevel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSsisTaskOutputProjectLevel if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSsisTaskOutputProjectLevel. + */ + public static MigrateSsisTaskOutputProjectLevel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSsisTaskOutputProjectLevel deserializedMigrateSsisTaskOutputProjectLevel + = new MigrateSsisTaskOutputProjectLevel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.withId(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.resultType = reader.getString(); + } else if ("folderName".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.folderName = reader.getString(); + } else if ("projectName".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.projectName = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.state = MigrationState.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.stage + = SsisMigrationStage.fromString(reader.getString()); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("message".equals(fieldName)) { + deserializedMigrateSsisTaskOutputProjectLevel.message = reader.getString(); + } else if ("exceptionsAndWarnings".equals(fieldName)) { + List exceptionsAndWarnings + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedMigrateSsisTaskOutputProjectLevel.exceptionsAndWarnings = exceptionsAndWarnings; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSsisTaskOutputProjectLevel; + }); + } +} 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 000000000000..e6da41f20678 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +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. + */ +@Fluent +public final class MigrateSsisTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.MIGRATE_SSIS; + + /* + * Task input + */ + private MigrateSsisTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of MigrateSsisTaskProperties class. + */ + public MigrateSsisTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateSsisTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateSsisTaskProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateSsisTaskProperties. + */ + public static MigrateSsisTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateSsisTaskProperties deserializedMigrateSsisTaskProperties = new MigrateSsisTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMigrateSsisTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedMigrateSsisTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedMigrateSsisTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrateSsisTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedMigrateSsisTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMigrateSsisTaskProperties.input = MigrateSsisTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> MigrateSsisTaskOutput.fromJson(reader1)); + deserializedMigrateSsisTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateSsisTaskProperties; + }); + } +} 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 6fe556b5824f..d1f365dad0a9 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 @@ -9,6 +9,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; @@ -16,11 +17,11 @@ * Properties for the command that completes sync migration for a database. */ @Fluent -public final class MigrateSyncCompleteCommandProperties extends CommandProperties { +public final class MigrateSyncCompleteCommandProperties extends CommandPropertiesInner { /* * Command type. */ - private String commandType = "Migrate.Sync.Complete.Database"; + private CommandType commandType = CommandType.MIGRATE_SYNC_COMPLETE_DATABASE; /* * Command input @@ -32,6 +33,21 @@ public final class MigrateSyncCompleteCommandProperties extends CommandPropertie */ private MigrateSyncCompleteCommandOutput output; + /* + * Command id + */ + private String commandId; + + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + /** * Creates an instance of MigrateSyncCompleteCommandProperties class. */ @@ -44,7 +60,7 @@ public MigrateSyncCompleteCommandProperties() { * @return the commandType value. */ @Override - public String commandType() { + public CommandType commandType() { return this.commandType; } @@ -77,6 +93,46 @@ public MigrateSyncCompleteCommandOutput output() { return this.output; } + /** + * Get the commandId property: Command id. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Set the commandId property: Command id. + * + * @param commandId the commandId value to set. + * @return the MigrateSyncCompleteCommandProperties object itself. + */ + public MigrateSyncCompleteCommandProperties withCommandId(String commandId) { + this.commandId = commandId; + return this; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + @Override + public CommandState state() { + return this.state; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + @Override + public List errors() { + return this.errors; + } + /** * Validates the instance. * @@ -98,8 +154,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commandType", this.commandType); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); jsonWriter.writeJsonField("input", this.input); + jsonWriter.writeStringField("commandId", this.commandId); return jsonWriter.writeEndObject(); } @@ -121,18 +178,21 @@ public static MigrateSyncCompleteCommandProperties fromJson(JsonReader jsonReade if ("errors".equals(fieldName)) { List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedMigrateSyncCompleteCommandProperties.withErrors(errors); + deserializedMigrateSyncCompleteCommandProperties.errors = errors; } else if ("state".equals(fieldName)) { - deserializedMigrateSyncCompleteCommandProperties - .withState(CommandState.fromString(reader.getString())); + deserializedMigrateSyncCompleteCommandProperties.state + = CommandState.fromString(reader.getString()); } else if ("commandType".equals(fieldName)) { - deserializedMigrateSyncCompleteCommandProperties.commandType = reader.getString(); + deserializedMigrateSyncCompleteCommandProperties.commandType + = CommandType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedMigrateSyncCompleteCommandProperties.input = MigrateSyncCompleteCommandInput.fromJson(reader); } else if ("output".equals(fieldName)) { deserializedMigrateSyncCompleteCommandProperties.output = MigrateSyncCompleteCommandOutput.fromJson(reader); + } else if ("commandId".equals(fieldName)) { + deserializedMigrateSyncCompleteCommandProperties.commandId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java new file mode 100644 index 000000000000..993696f15795 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationOperationInput.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; +import java.util.UUID; + +/** + * Migration Operation Input. + */ +@Fluent +public final class MigrationOperationInput implements JsonSerializable { + /* + * ID tracking migration operation. + */ + private UUID migrationOperationId; + + /** + * Creates an instance of MigrationOperationInput class. + */ + public MigrationOperationInput() { + } + + /** + * Get the migrationOperationId property: ID tracking migration operation. + * + * @return the migrationOperationId value. + */ + public UUID migrationOperationId() { + return this.migrationOperationId; + } + + /** + * Set the migrationOperationId property: ID tracking migration operation. + * + * @param migrationOperationId the migrationOperationId value to set. + * @return the MigrationOperationInput object itself. + */ + public MigrationOperationInput withMigrationOperationId(UUID migrationOperationId) { + this.migrationOperationId = migrationOperationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("migrationOperationId", Objects.toString(this.migrationOperationId, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationOperationInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationOperationInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationOperationInput. + */ + public static MigrationOperationInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationOperationInput deserializedMigrationOperationInput = new MigrationOperationInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationOperationId".equals(fieldName)) { + deserializedMigrationOperationInput.migrationOperationId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationOperationInput; + }); + } +} 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 e693c319321d..e2de06f77480 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Migration validation report result, contains the url for downloading the generated report. */ -@Immutable +@Fluent public final class MigrationReportResult implements JsonSerializable { /* * Migration validation result identifier @@ -41,6 +41,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. * @@ -50,6 +61,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. * @@ -64,6 +86,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("reportUrl", this.reportUrl); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationService.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationService.java new file mode 100644 index 000000000000..d677d9275790 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationService.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import java.util.Map; + +/** + * An immutable client-side representation of MigrationService. + */ +public interface MigrationService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + String integrationRuntimeState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner object. + * + * @return the inner object. + */ + MigrationServiceInner innerModel(); + + /** + * The entirety of the MigrationService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The MigrationService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MigrationService definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the MigrationService definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the MigrationService definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the MigrationService definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + MigrationService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MigrationService create(Context context); + } + + /** + * The stage of the MigrationService definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + + /** + * Begins update for the MigrationService resource. + * + * @return the stage of resource update. + */ + MigrationService.Update update(); + + /** + * The template for MigrationService update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MigrationService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MigrationService apply(Context context); + } + + /** + * The MigrationService update stages. + */ + interface UpdateStages { + /** + * The stage of the MigrationService update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MigrationService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MigrationService refresh(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceListResult.java new file mode 100644 index 000000000000..dda4f2084d82 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.MigrationServiceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of Migration Service. + */ +@Immutable +public final class MigrationServiceListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of MigrationServiceListResult class. + */ + public MigrationServiceListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationServiceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationServiceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationServiceListResult. + */ + public static MigrationServiceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationServiceListResult deserializedMigrationServiceListResult = new MigrationServiceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MigrationServiceInner.fromJson(reader1)); + deserializedMigrationServiceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMigrationServiceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationServiceListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceUpdate.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceUpdate.java new file mode 100644 index 000000000000..3142f9434550 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServiceUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * An update to a Migration Service. + */ +@Fluent +public final class MigrationServiceUpdate implements JsonSerializable { + /* + * Dictionary of + */ + private Map tags; + + /** + * Creates an instance of MigrationServiceUpdate class. + */ + public MigrationServiceUpdate() { + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the MigrationServiceUpdate object itself. + */ + public MigrationServiceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationServiceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationServiceUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationServiceUpdate. + */ + public static MigrationServiceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationServiceUpdate deserializedMigrationServiceUpdate = new MigrationServiceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMigrationServiceUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationServiceUpdate; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServices.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServices.java new file mode 100644 index 000000000000..3f9a8cd45a32 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationServices.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights 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 MigrationServices. + */ +public interface MigrationServices { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String migrationServiceName, + Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service. + */ + MigrationService getByResourceGroup(String resourceGroupName, String migrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String migrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String migrationServiceName, Context context); + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve all migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieve all migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations(String resourceGroupName, String migrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param migrationServiceName Name of the Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations(String resourceGroupName, String migrationServiceName, + Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response}. + */ + MigrationService getById(String id); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Migration Service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MigrationService resource. + * + * @param name resource name. + * @return the first stage of the new MigrationService definition. + */ + MigrationService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java new file mode 100644 index 000000000000..049ff0e64efc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatusDetails.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Detailed status of current migration. + */ +@Immutable +public final class MigrationStatusDetails implements JsonSerializable { + /* + * Current State of Migration. + */ + private String migrationState; + + /* + * Details of full backup set. + */ + private SqlBackupSetInfo fullBackupSetInfo; + + /* + * Last applied backup set information. + */ + private SqlBackupSetInfo lastRestoredBackupSetInfo; + + /* + * Backup sets that are currently active. + */ + private List activeBackupSets; + + /* + * Files that are not valid backup files. + */ + private List invalidFiles; + + /* + * Name of blob container. + */ + private String blobContainerName; + + /* + * Whether full backup has been applied to the target database or not. + */ + private Boolean isFullBackupRestored; + + /* + * Restore blocking reason, if any + */ + private String restoreBlockingReason; + + /* + * Complete restore error message, if any + */ + private String completeRestoreErrorMessage; + + /* + * File upload blocking errors, if any. + */ + private List fileUploadBlockingErrors; + + /* + * File name that is currently being restored. + */ + private String currentRestoringFilename; + + /* + * Last restored file name. + */ + private String lastRestoredFilename; + + /* + * Total pending log backups. + */ + private Integer pendingLogBackupsCount; + + /** + * Creates an instance of MigrationStatusDetails class. + */ + public MigrationStatusDetails() { + } + + /** + * Get the migrationState property: Current State of Migration. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.migrationState; + } + + /** + * Get the fullBackupSetInfo property: Details of full backup set. + * + * @return the fullBackupSetInfo value. + */ + public SqlBackupSetInfo fullBackupSetInfo() { + return this.fullBackupSetInfo; + } + + /** + * Get the lastRestoredBackupSetInfo property: Last applied backup set information. + * + * @return the lastRestoredBackupSetInfo value. + */ + public SqlBackupSetInfo lastRestoredBackupSetInfo() { + return this.lastRestoredBackupSetInfo; + } + + /** + * Get the activeBackupSets property: Backup sets that are currently active. + * + * @return the activeBackupSets value. + */ + public List activeBackupSets() { + return this.activeBackupSets; + } + + /** + * Get the invalidFiles property: Files that are not valid backup files. + * + * @return the invalidFiles value. + */ + public List invalidFiles() { + return this.invalidFiles; + } + + /** + * Get the blobContainerName property: Name of blob container. + * + * @return the blobContainerName value. + */ + public String blobContainerName() { + return this.blobContainerName; + } + + /** + * Get the isFullBackupRestored property: Whether full backup has been applied to the target database or not. + * + * @return the isFullBackupRestored value. + */ + public Boolean isFullBackupRestored() { + return this.isFullBackupRestored; + } + + /** + * Get the restoreBlockingReason property: Restore blocking reason, if any. + * + * @return the restoreBlockingReason value. + */ + public String restoreBlockingReason() { + return this.restoreBlockingReason; + } + + /** + * Get the completeRestoreErrorMessage property: Complete restore error message, if any. + * + * @return the completeRestoreErrorMessage value. + */ + public String completeRestoreErrorMessage() { + return this.completeRestoreErrorMessage; + } + + /** + * Get the fileUploadBlockingErrors property: File upload blocking errors, if any. + * + * @return the fileUploadBlockingErrors value. + */ + public List fileUploadBlockingErrors() { + return this.fileUploadBlockingErrors; + } + + /** + * Get the currentRestoringFilename property: File name that is currently being restored. + * + * @return the currentRestoringFilename value. + */ + public String currentRestoringFilename() { + return this.currentRestoringFilename; + } + + /** + * Get the lastRestoredFilename property: Last restored file name. + * + * @return the lastRestoredFilename value. + */ + public String lastRestoredFilename() { + return this.lastRestoredFilename; + } + + /** + * Get the pendingLogBackupsCount property: Total pending log backups. + * + * @return the pendingLogBackupsCount value. + */ + public Integer pendingLogBackupsCount() { + return this.pendingLogBackupsCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fullBackupSetInfo() != null) { + fullBackupSetInfo().validate(); + } + if (lastRestoredBackupSetInfo() != null) { + lastRestoredBackupSetInfo().validate(); + } + if (activeBackupSets() != null) { + activeBackupSets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationStatusDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationStatusDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationStatusDetails. + */ + public static MigrationStatusDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationStatusDetails deserializedMigrationStatusDetails = new MigrationStatusDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationState".equals(fieldName)) { + deserializedMigrationStatusDetails.migrationState = reader.getString(); + } else if ("fullBackupSetInfo".equals(fieldName)) { + deserializedMigrationStatusDetails.fullBackupSetInfo = SqlBackupSetInfo.fromJson(reader); + } else if ("lastRestoredBackupSetInfo".equals(fieldName)) { + deserializedMigrationStatusDetails.lastRestoredBackupSetInfo = SqlBackupSetInfo.fromJson(reader); + } else if ("activeBackupSets".equals(fieldName)) { + List activeBackupSets + = reader.readArray(reader1 -> SqlBackupSetInfo.fromJson(reader1)); + deserializedMigrationStatusDetails.activeBackupSets = activeBackupSets; + } else if ("invalidFiles".equals(fieldName)) { + List invalidFiles = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationStatusDetails.invalidFiles = invalidFiles; + } else if ("blobContainerName".equals(fieldName)) { + deserializedMigrationStatusDetails.blobContainerName = reader.getString(); + } else if ("isFullBackupRestored".equals(fieldName)) { + deserializedMigrationStatusDetails.isFullBackupRestored + = reader.getNullable(JsonReader::getBoolean); + } else if ("restoreBlockingReason".equals(fieldName)) { + deserializedMigrationStatusDetails.restoreBlockingReason = reader.getString(); + } else if ("completeRestoreErrorMessage".equals(fieldName)) { + deserializedMigrationStatusDetails.completeRestoreErrorMessage = reader.getString(); + } else if ("fileUploadBlockingErrors".equals(fieldName)) { + List fileUploadBlockingErrors = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationStatusDetails.fileUploadBlockingErrors = fileUploadBlockingErrors; + } else if ("currentRestoringFilename".equals(fieldName)) { + deserializedMigrationStatusDetails.currentRestoringFilename = reader.getString(); + } else if ("lastRestoredFilename".equals(fieldName)) { + deserializedMigrationStatusDetails.lastRestoredFilename = reader.getString(); + } else if ("pendingLogBackupsCount".equals(fieldName)) { + deserializedMigrationStatusDetails.pendingLogBackupsCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationStatusDetails; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java new file mode 100644 index 000000000000..89ebfff6776b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseLevelResult.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Database level validation results. + */ +@Immutable +public class MigrationValidationDatabaseLevelResult + implements JsonSerializable { + /* + * Result identifier + */ + private String id; + + /* + * Migration Identifier + */ + private String migrationId; + + /* + * Name of the source database + */ + private String sourceDatabaseName; + + /* + * Name of the target database + */ + private String targetDatabaseName; + + /* + * Validation start time + */ + private OffsetDateTime startedOn; + + /* + * Validation end time + */ + private OffsetDateTime endedOn; + + /* + * Provides data integrity validation result between the source and target tables that are migrated. + */ + private DataIntegrityValidationResult dataIntegrityValidationResult; + + /* + * Provides schema comparison result between source and target database + */ + private SchemaComparisonValidationResult schemaValidationResult; + + /* + * Results of some of the query execution result between source and target database + */ + private QueryAnalysisValidationResult queryAnalysisValidationResult; + + /* + * Current status of validation at the database level + */ + private ValidationStatus status; + + /** + * Creates an instance of MigrationValidationDatabaseLevelResult class. + */ + public MigrationValidationDatabaseLevelResult() { + } + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Result identifier. + * + * @param id the id value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Set the migrationId property: Migration Identifier. + * + * @param migrationId the migrationId value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withMigrationId(String migrationId) { + this.migrationId = migrationId; + return this; + } + + /** + * Get the sourceDatabaseName property: Name of the source database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set the sourceDatabaseName property: Name of the source database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + + /** + * Get the targetDatabaseName property: Name of the target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of the target database. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the startedOn property: Validation start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Set the startedOn property: Validation start time. + * + * @param startedOn the startedOn value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withStartedOn(OffsetDateTime startedOn) { + this.startedOn = startedOn; + return this; + } + + /** + * Get the endedOn property: Validation end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Set the endedOn property: Validation end time. + * + * @param endedOn the endedOn value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withEndedOn(OffsetDateTime endedOn) { + this.endedOn = endedOn; + return this; + } + + /** + * 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; + } + + /** + * Set the dataIntegrityValidationResult property: Provides data integrity validation result between the source and + * target tables that are migrated. + * + * @param dataIntegrityValidationResult the dataIntegrityValidationResult value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult + withDataIntegrityValidationResult(DataIntegrityValidationResult dataIntegrityValidationResult) { + this.dataIntegrityValidationResult = dataIntegrityValidationResult; + return this; + } + + /** + * Get the schemaValidationResult property: Provides schema comparison result between source and target database. + * + * @return the schemaValidationResult value. + */ + public SchemaComparisonValidationResult schemaValidationResult() { + return this.schemaValidationResult; + } + + /** + * Set the schemaValidationResult property: Provides schema comparison result between source and target database. + * + * @param schemaValidationResult the schemaValidationResult value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult + withSchemaValidationResult(SchemaComparisonValidationResult schemaValidationResult) { + this.schemaValidationResult = schemaValidationResult; + return this; + } + + /** + * 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; + } + + /** + * Set the queryAnalysisValidationResult property: Results of some of the query execution result between source and + * target database. + * + * @param queryAnalysisValidationResult the queryAnalysisValidationResult value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult + withQueryAnalysisValidationResult(QueryAnalysisValidationResult queryAnalysisValidationResult) { + this.queryAnalysisValidationResult = queryAnalysisValidationResult; + return this; + } + + /** + * Get the status property: Current status of validation at the database level. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Set the status property: Current status of validation at the database level. + * + * @param status the status value to set. + * @return the MigrationValidationDatabaseLevelResult object itself. + */ + MigrationValidationDatabaseLevelResult withStatus(ValidationStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataIntegrityValidationResult() != null) { + dataIntegrityValidationResult().validate(); + } + if (schemaValidationResult() != null) { + schemaValidationResult().validate(); + } + if (queryAnalysisValidationResult() != null) { + queryAnalysisValidationResult().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationDatabaseLevelResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationDatabaseLevelResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationValidationDatabaseLevelResult. + */ + public static MigrationValidationDatabaseLevelResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationDatabaseLevelResult deserializedMigrationValidationDatabaseLevelResult + = new MigrationValidationDatabaseLevelResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.id = reader.getString(); + } else if ("migrationId".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.migrationId = reader.getString(); + } else if ("sourceDatabaseName".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.sourceDatabaseName = reader.getString(); + } else if ("targetDatabaseName".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.targetDatabaseName = reader.getString(); + } else if ("startedOn".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.startedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endedOn".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.endedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dataIntegrityValidationResult".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.dataIntegrityValidationResult + = DataIntegrityValidationResult.fromJson(reader); + } else if ("schemaValidationResult".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.schemaValidationResult + = SchemaComparisonValidationResult.fromJson(reader); + } else if ("queryAnalysisValidationResult".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.queryAnalysisValidationResult + = QueryAnalysisValidationResult.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedMigrationValidationDatabaseLevelResult.status + = ValidationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationDatabaseLevelResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java new file mode 100644 index 000000000000..979c2f1158df --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Migration Validation Result. + */ +@Fluent +public class MigrationValidationResult implements JsonSerializable { + /* + * Migration validation result identifier + */ + private String id; + + /* + * Migration Identifier + */ + private String migrationId; + + /* + * Validation summary results for each database + */ + private Map summaryResults; + + /* + * Current status of validation at the migration level. Status from the database validation result status will be + * aggregated here. + */ + private ValidationStatus status; + + /** + * Creates an instance of MigrationValidationResult class. + */ + public MigrationValidationResult() { + } + + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Migration validation result identifier. + * + * @param id the id value to set. + * @return the MigrationValidationResult object itself. + */ + MigrationValidationResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Set the migrationId property: Migration Identifier. + * + * @param migrationId the migrationId value to set. + * @return the MigrationValidationResult object itself. + */ + MigrationValidationResult withMigrationId(String migrationId) { + this.migrationId = migrationId; + return this; + } + + /** + * Get the summaryResults property: Validation summary results for each database. + * + * @return the summaryResults value. + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set the summaryResults property: Validation summary results for each database. + * + * @param summaryResults the summaryResults value to set. + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult + withSummaryResults(Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get the status property: Current status of validation at the migration level. Status from the database validation + * result status will be aggregated here. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Set the status property: Current status of validation at the migration level. Status from the database validation + * result status will be aggregated here. + * + * @param status the status value to set. + * @return the MigrationValidationResult object itself. + */ + MigrationValidationResult withStatus(ValidationStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summaryResults() != null) { + summaryResults().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("summaryResults", this.summaryResults, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationValidationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationValidationResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationValidationResult. + */ + public static MigrationValidationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationValidationResult deserializedMigrationValidationResult = new MigrationValidationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMigrationValidationResult.id = reader.getString(); + } else if ("migrationId".equals(fieldName)) { + deserializedMigrationValidationResult.migrationId = reader.getString(); + } else if ("summaryResults".equals(fieldName)) { + Map summaryResults + = reader.readMap(reader1 -> MigrationValidationDatabaseSummaryResult.fromJson(reader1)); + deserializedMigrationValidationResult.summaryResults = summaryResults; + } else if ("status".equals(fieldName)) { + deserializedMigrationValidationResult.status = ValidationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationValidationResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoConnectionInformation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoConnectionInformation.java new file mode 100644 index 000000000000..411177f6d778 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoConnectionInformation.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Mongo Connection. + */ +@Fluent +public final class MongoConnectionInformation implements JsonSerializable { + /* + * Host of mongo connection. + */ + private String host; + + /* + * Port of mongo connection. + */ + private Integer port; + + /* + * User name to connect to Mongo. + */ + private String username; + + /* + * Password to connect to Mongo. + */ + private String password; + + /* + * Whether to UseSsl or UseTls to connect to Mongo. Default is true. + */ + private Boolean useSsl; + + /* + * ConnectionString to connect to Mongo. + */ + private String connectionString; + + /** + * Creates an instance of MongoConnectionInformation class. + */ + public MongoConnectionInformation() { + } + + /** + * Get the host property: Host of mongo connection. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: Host of mongo connection. + * + * @param host the host value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the port property: Port of mongo connection. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port of mongo connection. + * + * @param port the port value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the username property: User name to connect to Mongo. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name to connect to Mongo. + * + * @param username the username value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password to connect to Mongo. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password to connect to Mongo. + * + * @param password the password value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the useSsl property: Whether to UseSsl or UseTls to connect to Mongo. Default is true. + * + * @return the useSsl value. + */ + public Boolean useSsl() { + return this.useSsl; + } + + /** + * Set the useSsl property: Whether to UseSsl or UseTls to connect to Mongo. Default is true. + * + * @param useSsl the useSsl value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withUseSsl(Boolean useSsl) { + this.useSsl = useSsl; + return this; + } + + /** + * Get the connectionString property: ConnectionString to connect to Mongo. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: ConnectionString to connect to Mongo. + * + * @param connectionString the connectionString value to set. + * @return the MongoConnectionInformation object itself. + */ + public MongoConnectionInformation withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeBooleanField("useSsl", this.useSsl); + jsonWriter.writeStringField("connectionString", this.connectionString); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoConnectionInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoConnectionInformation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoConnectionInformation. + */ + public static MongoConnectionInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoConnectionInformation deserializedMongoConnectionInformation = new MongoConnectionInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("host".equals(fieldName)) { + deserializedMongoConnectionInformation.host = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedMongoConnectionInformation.port = reader.getNullable(JsonReader::getInt); + } else if ("userName".equals(fieldName)) { + deserializedMongoConnectionInformation.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedMongoConnectionInformation.password = reader.getString(); + } else if ("useSsl".equals(fieldName)) { + deserializedMongoConnectionInformation.useSsl = reader.getNullable(JsonReader::getBoolean); + } else if ("connectionString".equals(fieldName)) { + deserializedMongoConnectionInformation.connectionString = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoConnectionInformation; + }); + } +} 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 000000000000..c574ee1a6f19 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; + +/** + * Properties for the command that cancels a migration in whole or in part. + */ +@Fluent +public final class MongoDbCancelCommand extends CommandPropertiesInner { + /* + * Command type. + */ + private CommandType commandType = CommandType.CANCEL; + + /* + * Command input + */ + private MongoDbCommandInput input; + + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + + /** + * Creates an instance of MongoDbCancelCommand class. + */ + public MongoDbCancelCommand() { + } + + /** + * Get the commandType property: Command type. + * + * @return the commandType value. + */ + @Override + public CommandType commandType() { + return this.commandType; + } + + /** + * 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; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + @Override + public CommandState state() { + return this.state; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + @Override + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbCancelCommand from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbCancelCommand if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbCancelCommand. + */ + public static MongoDbCancelCommand fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbCancelCommand deserializedMongoDbCancelCommand = new MongoDbCancelCommand(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMongoDbCancelCommand.errors = errors; + } else if ("state".equals(fieldName)) { + deserializedMongoDbCancelCommand.state = CommandState.fromString(reader.getString()); + } else if ("commandType".equals(fieldName)) { + deserializedMongoDbCancelCommand.commandType = CommandType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMongoDbCancelCommand.input = MongoDbCommandInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbCancelCommand; + }); + } +} 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 000000000000..02cad648cad5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a MongoDB data source. + */ +@Fluent +public final class MongoDbClusterInfo implements JsonSerializable { + /* + * A list of non-system databases in the cluster + */ + private List databases; + + /* + * Whether the cluster supports sharded collections + */ + private boolean supportsSharding; + + /* + * The type of data source + */ + 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. + */ + private String version; + + /** + * Creates an instance of MongoDbClusterInfo class. + */ + public MongoDbClusterInfo() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property databases in model MongoDbClusterInfo")); + } else { + databases().forEach(e -> e.validate()); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model MongoDbClusterInfo")); + } + if (version() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property version in model MongoDbClusterInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbClusterInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("databases", this.databases, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("supportsSharding", this.supportsSharding); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbClusterInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbClusterInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbClusterInfo. + */ + public static MongoDbClusterInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbClusterInfo deserializedMongoDbClusterInfo = new MongoDbClusterInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databases".equals(fieldName)) { + List databases + = reader.readArray(reader1 -> MongoDbDatabaseInfo.fromJson(reader1)); + deserializedMongoDbClusterInfo.databases = databases; + } else if ("supportsSharding".equals(fieldName)) { + deserializedMongoDbClusterInfo.supportsSharding = reader.getBoolean(); + } else if ("type".equals(fieldName)) { + deserializedMongoDbClusterInfo.type = MongoDbClusterType.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMongoDbClusterInfo.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbClusterInfo; + }); + } +} 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 000000000000..15adf2e0be43 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of data source. + */ +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 a new instance of MongoDbClusterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbClusterType() { + } + + /** + * Creates or finds a MongoDbClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbClusterType. + */ + public static MongoDbClusterType fromString(String name) { + return fromString(name, MongoDbClusterType.class); + } + + /** + * Gets known MongoDbClusterType values. + * + * @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 000000000000..5523e2c09447 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a supported collection within a MongoDB database. + */ +@Fluent +public final class MongoDbCollectionInfo extends MongoDbObjectInfo { + /* + * The name of the database containing the collection + */ + private String databaseName; + + /* + * Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a circular buffer) + */ + private boolean isCapped; + + /* + * Whether the collection is system collection + */ + private boolean isSystemCollection; + + /* + * Whether the collection is a view of another collection + */ + private boolean isView; + + /* + * The shard key on the collection, or null if the collection is not sharded + */ + private MongoDbShardKeyInfo shardKey; + + /* + * Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if + * necessary. + */ + private boolean supportsSharding; + + /* + * The name of the collection that this is a view of, if IsView is true + */ + private String viewOf; + + /** + * Creates an instance of MongoDbCollectionInfo class. + */ + public MongoDbCollectionInfo() { + } + + /** + * 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() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model MongoDbCollectionInfo")); + } + if (shardKey() != null) { + shardKey().validate(); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model MongoDbCollectionInfo")); + } + if (qualifiedName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property qualifiedName in model MongoDbCollectionInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbCollectionInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("averageDocumentSize", averageDocumentSize()); + jsonWriter.writeLongField("dataSize", dataSize()); + jsonWriter.writeLongField("documentCount", documentCount()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("qualifiedName", qualifiedName()); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeBooleanField("isCapped", this.isCapped); + jsonWriter.writeBooleanField("isSystemCollection", this.isSystemCollection); + jsonWriter.writeBooleanField("isView", this.isView); + jsonWriter.writeBooleanField("supportsSharding", this.supportsSharding); + jsonWriter.writeJsonField("shardKey", this.shardKey); + jsonWriter.writeStringField("viewOf", this.viewOf); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbCollectionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbCollectionInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbCollectionInfo. + */ + public static MongoDbCollectionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbCollectionInfo deserializedMongoDbCollectionInfo = new MongoDbCollectionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("averageDocumentSize".equals(fieldName)) { + deserializedMongoDbCollectionInfo.withAverageDocumentSize(reader.getLong()); + } else if ("dataSize".equals(fieldName)) { + deserializedMongoDbCollectionInfo.withDataSize(reader.getLong()); + } else if ("documentCount".equals(fieldName)) { + deserializedMongoDbCollectionInfo.withDocumentCount(reader.getLong()); + } else if ("name".equals(fieldName)) { + deserializedMongoDbCollectionInfo.withName(reader.getString()); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbCollectionInfo.withQualifiedName(reader.getString()); + } else if ("databaseName".equals(fieldName)) { + deserializedMongoDbCollectionInfo.databaseName = reader.getString(); + } else if ("isCapped".equals(fieldName)) { + deserializedMongoDbCollectionInfo.isCapped = reader.getBoolean(); + } else if ("isSystemCollection".equals(fieldName)) { + deserializedMongoDbCollectionInfo.isSystemCollection = reader.getBoolean(); + } else if ("isView".equals(fieldName)) { + deserializedMongoDbCollectionInfo.isView = reader.getBoolean(); + } else if ("supportsSharding".equals(fieldName)) { + deserializedMongoDbCollectionInfo.supportsSharding = reader.getBoolean(); + } else if ("shardKey".equals(fieldName)) { + deserializedMongoDbCollectionInfo.shardKey = MongoDbShardKeyInfo.fromJson(reader); + } else if ("viewOf".equals(fieldName)) { + deserializedMongoDbCollectionInfo.viewOf = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbCollectionInfo; + }); + } +} 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 000000000000..b86b56e2e076 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Describes the progress of a collection. + */ +@Fluent +public final class MongoDbCollectionProgress extends MongoDbProgress { + /* + * The type of progress object + */ + private MongoDbProgressResultType resultType = MongoDbProgressResultType.COLLECTION; + + /** + * Creates an instance of MongoDbCollectionProgress class. + */ + public MongoDbCollectionProgress() { + } + + /** + * Get the resultType property: The type of progress object. + * + * @return the resultType value. + */ + @Override + public MongoDbProgressResultType resultType() { + return this.resultType; + } + + /** + * {@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() { + if (elapsedTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property elapsedTime in model MongoDbCollectionProgress")); + } + if (errors() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property errors in model MongoDbCollectionProgress")); + } else { + errors().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property state in model MongoDbCollectionProgress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbCollectionProgress.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("bytesCopied", bytesCopied()); + jsonWriter.writeLongField("documentsCopied", documentsCopied()); + jsonWriter.writeStringField("elapsedTime", elapsedTime()); + jsonWriter.writeMapField("errors", errors(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("eventsPending", eventsPending()); + jsonWriter.writeLongField("eventsReplayed", eventsReplayed()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeLongField("totalBytes", totalBytes()); + jsonWriter.writeLongField("totalDocuments", totalDocuments()); + jsonWriter.writeStringField("lastEventTime", + lastEventTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastEventTime())); + jsonWriter.writeStringField("lastReplayTime", + lastReplayTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastReplayTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("qualifiedName", qualifiedName()); + jsonWriter.writeStringField("resultType", this.resultType == null ? null : this.resultType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbCollectionProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbCollectionProgress if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbCollectionProgress. + */ + public static MongoDbCollectionProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbCollectionProgress deserializedMongoDbCollectionProgress = new MongoDbCollectionProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bytesCopied".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withBytesCopied(reader.getLong()); + } else if ("documentsCopied".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withDocumentsCopied(reader.getLong()); + } else if ("elapsedTime".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withElapsedTime(reader.getString()); + } else if ("errors".equals(fieldName)) { + Map errors = reader.readMap(reader1 -> MongoDbError.fromJson(reader1)); + deserializedMongoDbCollectionProgress.withErrors(errors); + } else if ("eventsPending".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withEventsPending(reader.getLong()); + } else if ("eventsReplayed".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withEventsReplayed(reader.getLong()); + } else if ("state".equals(fieldName)) { + deserializedMongoDbCollectionProgress + .withState(MongoDbMigrationState.fromString(reader.getString())); + } else if ("totalBytes".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withTotalBytes(reader.getLong()); + } else if ("totalDocuments".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withTotalDocuments(reader.getLong()); + } else if ("lastEventTime".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withLastEventTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastReplayTime".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withLastReplayTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withName(reader.getString()); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbCollectionProgress.withQualifiedName(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMongoDbCollectionProgress.resultType + = MongoDbProgressResultType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbCollectionProgress; + }); + } +} 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 000000000000..0b7edd785840 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes how an individual MongoDB collection should be migrated. + */ +@Fluent +public final class MongoDbCollectionSettings implements JsonSerializable { + /* + * Whether the migrator is allowed to drop the target collection in the course of performing a migration. The + * default is true. + */ + private Boolean canDelete; + + /* + * Describes a MongoDB shard key + */ + 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. + */ + private Integer targetRUs; + + /** + * Creates an instance of MongoDbCollectionSettings class. + */ + public MongoDbCollectionSettings() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("canDelete", this.canDelete); + jsonWriter.writeJsonField("shardKey", this.shardKey); + jsonWriter.writeNumberField("targetRUs", this.targetRUs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbCollectionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbCollectionSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbCollectionSettings. + */ + public static MongoDbCollectionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbCollectionSettings deserializedMongoDbCollectionSettings = new MongoDbCollectionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("canDelete".equals(fieldName)) { + deserializedMongoDbCollectionSettings.canDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("shardKey".equals(fieldName)) { + deserializedMongoDbCollectionSettings.shardKey = MongoDbShardKeySetting.fromJson(reader); + } else if ("targetRUs".equals(fieldName)) { + deserializedMongoDbCollectionSettings.targetRUs = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbCollectionSettings; + }); + } +} 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 000000000000..0da800348501 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the input to the 'cancel' and 'restart' MongoDB migration commands. + */ +@Fluent +public class MongoDbCommandInput implements JsonSerializable { + /* + * The qualified name of a database or collection to act upon, or null to act upon the entire migration + */ + private String objectName; + + /** + * Creates an instance of MongoDbCommandInput class. + */ + public MongoDbCommandInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectName", this.objectName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbCommandInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbCommandInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbCommandInput. + */ + public static MongoDbCommandInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbCommandInput deserializedMongoDbCommandInput = new MongoDbCommandInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectName".equals(fieldName)) { + deserializedMongoDbCommandInput.objectName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbCommandInput; + }); + } +} 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 000000000000..c6fd8fcdcbd7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a connection to a MongoDB data source. + */ +@Fluent +public final class MongoDbConnectionInfo extends ConnectionInfo { + /* + * Type of connection info + */ + private String type = "MongoDbConnectionInfo"; + + /* + * A MongoDB connection string or blob container URL. The user name and password can be specified here or in the + * userName and password properties + */ + private String connectionString; + + /* + * Data source + */ + private String dataSource; + + /* + * Whether to encrypt the connection + */ + private Boolean encryptConnection; + + /* + * server brand version + */ + private String serverBrandVersion; + + /* + * server version + */ + private String serverVersion; + + /* + * name of the server + */ + private String serverName; + + /* + * Whether to trust the server certificate + */ + private Boolean trustServerCertificate; + + /* + * The enforceSSL property. + */ + private Boolean enforceSsl; + + /* + * port for server + */ + private Integer port; + + /* + * Additional connection settings + */ + private String additionalSettings; + + /* + * Authentication type to use for connection + */ + private AuthenticationType authentication; + + /** + * Creates an instance of MongoDbConnectionInfo class. + */ + public MongoDbConnectionInfo() { + } + + /** + * Get the type property: Type of connection info. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @param connectionString the connectionString value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get the enforceSsl property: The enforceSSL property. + * + * @return the enforceSsl value. + */ + public Boolean enforceSsl() { + return this.enforceSsl; + } + + /** + * Set the enforceSsl property: The enforceSSL property. + * + * @param enforceSsl the enforceSsl value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withEnforceSsl(Boolean enforceSsl) { + this.enforceSsl = enforceSsl; + return this; + } + + /** + * Get the port property: port for server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: port for server. + * + * @param port the port value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MongoDbConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MongoDbConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (connectionString() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectionString in model MongoDbConnectionInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbConnectionInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userName", username()); + jsonWriter.writeStringField("password", password()); + jsonWriter.writeStringField("connectionString", this.connectionString); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("dataSource", this.dataSource); + jsonWriter.writeBooleanField("encryptConnection", this.encryptConnection); + jsonWriter.writeStringField("serverBrandVersion", this.serverBrandVersion); + jsonWriter.writeStringField("serverVersion", this.serverVersion); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeBooleanField("trustServerCertificate", this.trustServerCertificate); + jsonWriter.writeBooleanField("enforceSSL", this.enforceSsl); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("additionalSettings", this.additionalSettings); + jsonWriter.writeStringField("authentication", + this.authentication == null ? null : this.authentication.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbConnectionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbConnectionInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbConnectionInfo. + */ + public static MongoDbConnectionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbConnectionInfo deserializedMongoDbConnectionInfo = new MongoDbConnectionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userName".equals(fieldName)) { + deserializedMongoDbConnectionInfo.withUsername(reader.getString()); + } else if ("password".equals(fieldName)) { + deserializedMongoDbConnectionInfo.withPassword(reader.getString()); + } else if ("connectionString".equals(fieldName)) { + deserializedMongoDbConnectionInfo.connectionString = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMongoDbConnectionInfo.type = reader.getString(); + } else if ("dataSource".equals(fieldName)) { + deserializedMongoDbConnectionInfo.dataSource = reader.getString(); + } else if ("encryptConnection".equals(fieldName)) { + deserializedMongoDbConnectionInfo.encryptConnection = reader.getNullable(JsonReader::getBoolean); + } else if ("serverBrandVersion".equals(fieldName)) { + deserializedMongoDbConnectionInfo.serverBrandVersion = reader.getString(); + } else if ("serverVersion".equals(fieldName)) { + deserializedMongoDbConnectionInfo.serverVersion = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedMongoDbConnectionInfo.serverName = reader.getString(); + } else if ("trustServerCertificate".equals(fieldName)) { + deserializedMongoDbConnectionInfo.trustServerCertificate + = reader.getNullable(JsonReader::getBoolean); + } else if ("enforceSSL".equals(fieldName)) { + deserializedMongoDbConnectionInfo.enforceSsl = reader.getNullable(JsonReader::getBoolean); + } else if ("port".equals(fieldName)) { + deserializedMongoDbConnectionInfo.port = reader.getNullable(JsonReader::getInt); + } else if ("additionalSettings".equals(fieldName)) { + deserializedMongoDbConnectionInfo.additionalSettings = reader.getString(); + } else if ("authentication".equals(fieldName)) { + deserializedMongoDbConnectionInfo.authentication + = AuthenticationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbConnectionInfo; + }); + } +} 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 000000000000..7be82751d60e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a database within a MongoDB data source. + */ +@Fluent +public final class MongoDbDatabaseInfo extends MongoDbObjectInfo { + /* + * A list of supported collections in a MongoDB database + */ + private List collections; + + /* + * Whether the database has sharding enabled. Note that the migration task will enable sharding on the target if + * necessary. + */ + private boolean supportsSharding; + + /** + * Creates an instance of MongoDbDatabaseInfo class. + */ + public MongoDbDatabaseInfo() { + } + + /** + * 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() { + if (collections() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property collections in model MongoDbDatabaseInfo")); + } else { + collections().forEach(e -> e.validate()); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model MongoDbDatabaseInfo")); + } + if (qualifiedName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property qualifiedName in model MongoDbDatabaseInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbDatabaseInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("averageDocumentSize", averageDocumentSize()); + jsonWriter.writeLongField("dataSize", dataSize()); + jsonWriter.writeLongField("documentCount", documentCount()); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("qualifiedName", qualifiedName()); + jsonWriter.writeArrayField("collections", this.collections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("supportsSharding", this.supportsSharding); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbDatabaseInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbDatabaseInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbDatabaseInfo. + */ + public static MongoDbDatabaseInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbDatabaseInfo deserializedMongoDbDatabaseInfo = new MongoDbDatabaseInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("averageDocumentSize".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.withAverageDocumentSize(reader.getLong()); + } else if ("dataSize".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.withDataSize(reader.getLong()); + } else if ("documentCount".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.withDocumentCount(reader.getLong()); + } else if ("name".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.withName(reader.getString()); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.withQualifiedName(reader.getString()); + } else if ("collections".equals(fieldName)) { + List collections + = reader.readArray(reader1 -> MongoDbCollectionInfo.fromJson(reader1)); + deserializedMongoDbDatabaseInfo.collections = collections; + } else if ("supportsSharding".equals(fieldName)) { + deserializedMongoDbDatabaseInfo.supportsSharding = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbDatabaseInfo; + }); + } +} 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 000000000000..88be38096c5f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Describes the progress of a database. + */ +@Fluent +public final class MongoDbDatabaseProgress extends MongoDbProgress { + /* + * The type of progress object + */ + private MongoDbProgressResultType resultType = MongoDbProgressResultType.DATABASE; + + /* + * The progress of the collections in the database. The keys are the unqualified names of the collections + */ + private Map collections; + + /** + * Creates an instance of MongoDbDatabaseProgress class. + */ + public MongoDbDatabaseProgress() { + } + + /** + * Get the resultType property: The type of progress object. + * + * @return the resultType value. + */ + @Override + public MongoDbProgressResultType resultType() { + return this.resultType; + } + + /** + * 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() { + if (collections() != null) { + collections().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (elapsedTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property elapsedTime in model MongoDbDatabaseProgress")); + } + if (errors() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property errors in model MongoDbDatabaseProgress")); + } else { + errors().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model MongoDbDatabaseProgress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbDatabaseProgress.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("bytesCopied", bytesCopied()); + jsonWriter.writeLongField("documentsCopied", documentsCopied()); + jsonWriter.writeStringField("elapsedTime", elapsedTime()); + jsonWriter.writeMapField("errors", errors(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("eventsPending", eventsPending()); + jsonWriter.writeLongField("eventsReplayed", eventsReplayed()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeLongField("totalBytes", totalBytes()); + jsonWriter.writeLongField("totalDocuments", totalDocuments()); + jsonWriter.writeStringField("lastEventTime", + lastEventTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastEventTime())); + jsonWriter.writeStringField("lastReplayTime", + lastReplayTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastReplayTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("qualifiedName", qualifiedName()); + jsonWriter.writeStringField("resultType", this.resultType == null ? null : this.resultType.toString()); + jsonWriter.writeMapField("collections", this.collections, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbDatabaseProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbDatabaseProgress if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbDatabaseProgress. + */ + public static MongoDbDatabaseProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbDatabaseProgress deserializedMongoDbDatabaseProgress = new MongoDbDatabaseProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bytesCopied".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withBytesCopied(reader.getLong()); + } else if ("documentsCopied".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withDocumentsCopied(reader.getLong()); + } else if ("elapsedTime".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withElapsedTime(reader.getString()); + } else if ("errors".equals(fieldName)) { + Map errors = reader.readMap(reader1 -> MongoDbError.fromJson(reader1)); + deserializedMongoDbDatabaseProgress.withErrors(errors); + } else if ("eventsPending".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withEventsPending(reader.getLong()); + } else if ("eventsReplayed".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withEventsReplayed(reader.getLong()); + } else if ("state".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withState(MongoDbMigrationState.fromString(reader.getString())); + } else if ("totalBytes".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withTotalBytes(reader.getLong()); + } else if ("totalDocuments".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withTotalDocuments(reader.getLong()); + } else if ("lastEventTime".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withLastEventTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastReplayTime".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withLastReplayTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withName(reader.getString()); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.withQualifiedName(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMongoDbDatabaseProgress.resultType + = MongoDbProgressResultType.fromString(reader.getString()); + } else if ("collections".equals(fieldName)) { + Map collections + = reader.readMap(reader1 -> MongoDbCollectionProgress.fromJson(reader1)); + deserializedMongoDbDatabaseProgress.collections = collections; + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbDatabaseProgress; + }); + } +} 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 000000000000..2beb393fb4bf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Describes how an individual MongoDB database should be migrated. + */ +@Fluent +public final class MongoDbDatabaseSettings implements JsonSerializable { + /* + * The collections on the source database to migrate to the target. The keys are the unqualified names of the + * collections. + */ + 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. + */ + private Integer targetRUs; + + /** + * Creates an instance of MongoDbDatabaseSettings class. + */ + public MongoDbDatabaseSettings() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property collections in model MongoDbDatabaseSettings")); + } else { + collections().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbDatabaseSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("collections", this.collections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("targetRUs", this.targetRUs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbDatabaseSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbDatabaseSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbDatabaseSettings. + */ + public static MongoDbDatabaseSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbDatabaseSettings deserializedMongoDbDatabaseSettings = new MongoDbDatabaseSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("collections".equals(fieldName)) { + Map collections + = reader.readMap(reader1 -> MongoDbCollectionSettings.fromJson(reader1)); + deserializedMongoDbDatabaseSettings.collections = collections; + } else if ("targetRUs".equals(fieldName)) { + deserializedMongoDbDatabaseSettings.targetRUs = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbDatabaseSettings; + }); + } +} 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 000000000000..f8fe21f55389 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes an error or warning that occurred during a MongoDB migration. + */ +@Fluent +public final class MongoDbError implements JsonSerializable { + /* + * The non-localized, machine-readable code that describes the error or warning + */ + private String code; + + /* + * The number of times the error or warning has occurred + */ + private Integer count; + + /* + * The localized, human-readable message that describes the error or warning + */ + private String message; + + /* + * The type of error or warning + */ + private MongoDbErrorType type; + + /** + * Creates an instance of MongoDbError class. + */ + public MongoDbError() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeNumberField("count", this.count); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbError if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbError. + */ + public static MongoDbError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbError deserializedMongoDbError = new MongoDbError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMongoDbError.code = reader.getString(); + } else if ("count".equals(fieldName)) { + deserializedMongoDbError.count = reader.getNullable(JsonReader::getInt); + } else if ("message".equals(fieldName)) { + deserializedMongoDbError.message = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMongoDbError.type = MongoDbErrorType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbError; + }); + } +} 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 000000000000..799a2ab6cda0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of error or warning. + */ +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 a new instance of MongoDbErrorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbErrorType() { + } + + /** + * Creates or finds a MongoDbErrorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbErrorType. + */ + public static MongoDbErrorType fromString(String name) { + return fromString(name, MongoDbErrorType.class); + } + + /** + * Gets known MongoDbErrorType values. + * + * @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 000000000000..1237954633d5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; + +/** + * Properties for the command that finishes a migration in whole or in part. + */ +@Fluent +public final class MongoDbFinishCommand extends CommandPropertiesInner { + /* + * Command type. + */ + private CommandType commandType = CommandType.FINISH; + + /* + * Command input + */ + private MongoDbFinishCommandInput input; + + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + + /** + * Creates an instance of MongoDbFinishCommand class. + */ + public MongoDbFinishCommand() { + } + + /** + * Get the commandType property: Command type. + * + * @return the commandType value. + */ + @Override + public CommandType commandType() { + return this.commandType; + } + + /** + * 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; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + @Override + public CommandState state() { + return this.state; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + @Override + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbFinishCommand from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbFinishCommand if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbFinishCommand. + */ + public static MongoDbFinishCommand fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbFinishCommand deserializedMongoDbFinishCommand = new MongoDbFinishCommand(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMongoDbFinishCommand.errors = errors; + } else if ("state".equals(fieldName)) { + deserializedMongoDbFinishCommand.state = CommandState.fromString(reader.getString()); + } else if ("commandType".equals(fieldName)) { + deserializedMongoDbFinishCommand.commandType = CommandType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMongoDbFinishCommand.input = MongoDbFinishCommandInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbFinishCommand; + }); + } +} 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 000000000000..0c50384877b3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the input to the 'finish' MongoDB migration command. + */ +@Fluent +public final class MongoDbFinishCommandInput extends MongoDbCommandInput { + /* + * If true, replication for the affected objects will be stopped immediately. If false, the migrator will finish + * replaying queued events before finishing the replication. + */ + private boolean immediate; + + /** + * Creates an instance of MongoDbFinishCommandInput class. + */ + public MongoDbFinishCommandInput() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectName", objectName()); + jsonWriter.writeBooleanField("immediate", this.immediate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbFinishCommandInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbFinishCommandInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbFinishCommandInput. + */ + public static MongoDbFinishCommandInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbFinishCommandInput deserializedMongoDbFinishCommandInput = new MongoDbFinishCommandInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("objectName".equals(fieldName)) { + deserializedMongoDbFinishCommandInput.withObjectName(reader.getString()); + } else if ("immediate".equals(fieldName)) { + deserializedMongoDbFinishCommandInput.immediate = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbFinishCommandInput; + }); + } +} 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 000000000000..08c1379c220b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Describes the progress of the overall migration. + */ +@Fluent +public final class MongoDbMigrationProgress extends MongoDbProgress { + /* + * The type of progress object + */ + private MongoDbProgressResultType resultType = MongoDbProgressResultType.MIGRATION; + + /* + * The progress of the databases in the migration. The keys are the names of the databases + */ + private Map databases; + + /** + * Creates an instance of MongoDbMigrationProgress class. + */ + public MongoDbMigrationProgress() { + } + + /** + * Get the resultType property: The type of progress object. + * + * @return the resultType value. + */ + @Override + public MongoDbProgressResultType resultType() { + return this.resultType; + } + + /** + * 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() { + if (databases() != null) { + databases().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (elapsedTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property elapsedTime in model MongoDbMigrationProgress")); + } + if (errors() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property errors in model MongoDbMigrationProgress")); + } else { + errors().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model MongoDbMigrationProgress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbMigrationProgress.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("bytesCopied", bytesCopied()); + jsonWriter.writeLongField("documentsCopied", documentsCopied()); + jsonWriter.writeStringField("elapsedTime", elapsedTime()); + jsonWriter.writeMapField("errors", errors(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("eventsPending", eventsPending()); + jsonWriter.writeLongField("eventsReplayed", eventsReplayed()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeLongField("totalBytes", totalBytes()); + jsonWriter.writeLongField("totalDocuments", totalDocuments()); + jsonWriter.writeStringField("lastEventTime", + lastEventTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastEventTime())); + jsonWriter.writeStringField("lastReplayTime", + lastReplayTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastReplayTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("qualifiedName", qualifiedName()); + jsonWriter.writeStringField("resultType", this.resultType == null ? null : this.resultType.toString()); + jsonWriter.writeMapField("databases", this.databases, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbMigrationProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbMigrationProgress if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbMigrationProgress. + */ + public static MongoDbMigrationProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbMigrationProgress deserializedMongoDbMigrationProgress = new MongoDbMigrationProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bytesCopied".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withBytesCopied(reader.getLong()); + } else if ("documentsCopied".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withDocumentsCopied(reader.getLong()); + } else if ("elapsedTime".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withElapsedTime(reader.getString()); + } else if ("errors".equals(fieldName)) { + Map errors = reader.readMap(reader1 -> MongoDbError.fromJson(reader1)); + deserializedMongoDbMigrationProgress.withErrors(errors); + } else if ("eventsPending".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withEventsPending(reader.getLong()); + } else if ("eventsReplayed".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withEventsReplayed(reader.getLong()); + } else if ("state".equals(fieldName)) { + deserializedMongoDbMigrationProgress + .withState(MongoDbMigrationState.fromString(reader.getString())); + } else if ("totalBytes".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withTotalBytes(reader.getLong()); + } else if ("totalDocuments".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withTotalDocuments(reader.getLong()); + } else if ("lastEventTime".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withLastEventTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastReplayTime".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withLastReplayTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withName(reader.getString()); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbMigrationProgress.withQualifiedName(reader.getString()); + } else if ("resultType".equals(fieldName)) { + deserializedMongoDbMigrationProgress.resultType + = MongoDbProgressResultType.fromString(reader.getString()); + } else if ("databases".equals(fieldName)) { + Map databases + = reader.readMap(reader1 -> MongoDbDatabaseProgress.fromJson(reader1)); + deserializedMongoDbMigrationProgress.databases = databases; + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbMigrationProgress; + }); + } +} 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 000000000000..d3119f203f61 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Describes how a MongoDB data migration should be performed. + */ +@Fluent +public final class MongoDbMigrationSettings implements JsonSerializable { + /* + * 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. + */ + private Integer boostRUs; + + /* + * The databases on the source cluster to migrate to the target. The keys are the names of the databases. + */ + private Map databases; + + /* + * Describes how changes will be replicated from the source to the target. The default is OneTime. + */ + private MongoDbReplication replication; + + /* + * Settings used to connect to the source cluster + */ + private MongoDbConnectionInfo source; + + /* + * Settings used to connect to the target cluster + */ + private MongoDbConnectionInfo target; + + /* + * Settings used to limit the resource usage of the migration + */ + private MongoDbThrottlingSettings throttling; + + /** + * Creates an instance of MongoDbMigrationSettings class. + */ + public MongoDbMigrationSettings() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property databases in model MongoDbMigrationSettings")); + } else { + databases().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (source() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property source in model MongoDbMigrationSettings")); + } else { + source().validate(); + } + if (target() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property target in model MongoDbMigrationSettings")); + } else { + target().validate(); + } + if (throttling() != null) { + throttling().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbMigrationSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("databases", this.databases, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("target", this.target); + jsonWriter.writeNumberField("boostRUs", this.boostRUs); + jsonWriter.writeStringField("replication", this.replication == null ? null : this.replication.toString()); + jsonWriter.writeJsonField("throttling", this.throttling); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbMigrationSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbMigrationSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbMigrationSettings. + */ + public static MongoDbMigrationSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbMigrationSettings deserializedMongoDbMigrationSettings = new MongoDbMigrationSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databases".equals(fieldName)) { + Map databases + = reader.readMap(reader1 -> MongoDbDatabaseSettings.fromJson(reader1)); + deserializedMongoDbMigrationSettings.databases = databases; + } else if ("source".equals(fieldName)) { + deserializedMongoDbMigrationSettings.source = MongoDbConnectionInfo.fromJson(reader); + } else if ("target".equals(fieldName)) { + deserializedMongoDbMigrationSettings.target = MongoDbConnectionInfo.fromJson(reader); + } else if ("boostRUs".equals(fieldName)) { + deserializedMongoDbMigrationSettings.boostRUs = reader.getNullable(JsonReader::getInt); + } else if ("replication".equals(fieldName)) { + deserializedMongoDbMigrationSettings.replication + = MongoDbReplication.fromString(reader.getString()); + } else if ("throttling".equals(fieldName)) { + deserializedMongoDbMigrationSettings.throttling = MongoDbThrottlingSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbMigrationSettings; + }); + } +} 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 000000000000..e698ef1351a1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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 a new instance of MongoDbMigrationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbMigrationState() { + } + + /** + * Creates or finds a MongoDbMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbMigrationState. + */ + public static MongoDbMigrationState fromString(String name) { + return fromString(name, MongoDbMigrationState.class); + } + + /** + * Gets known MongoDbMigrationState values. + * + * @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 000000000000..acadc3f9a81e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a database or collection within a MongoDB data source. + */ +@Fluent +public class MongoDbObjectInfo implements JsonSerializable { + /* + * The average document size, or -1 if the average size is unknown + */ + private long averageDocumentSize; + + /* + * The estimated total data size, in bytes, or -1 if the size is unknown. + */ + private long dataSize; + + /* + * The estimated total number of documents, or -1 if the document count is unknown + */ + private long documentCount; + + /* + * The unqualified name of the database or collection + */ + private String name; + + /* + * The qualified name of the database or collection. For a collection, this is the database-qualified name. + */ + private String qualifiedName; + + /** + * Creates an instance of MongoDbObjectInfo class. + */ + public MongoDbObjectInfo() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property name in model MongoDbObjectInfo")); + } + if (qualifiedName() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property qualifiedName in model MongoDbObjectInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbObjectInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("averageDocumentSize", this.averageDocumentSize); + jsonWriter.writeLongField("dataSize", this.dataSize); + jsonWriter.writeLongField("documentCount", this.documentCount); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("qualifiedName", this.qualifiedName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbObjectInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbObjectInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbObjectInfo. + */ + public static MongoDbObjectInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbObjectInfo deserializedMongoDbObjectInfo = new MongoDbObjectInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("averageDocumentSize".equals(fieldName)) { + deserializedMongoDbObjectInfo.averageDocumentSize = reader.getLong(); + } else if ("dataSize".equals(fieldName)) { + deserializedMongoDbObjectInfo.dataSize = reader.getLong(); + } else if ("documentCount".equals(fieldName)) { + deserializedMongoDbObjectInfo.documentCount = reader.getLong(); + } else if ("name".equals(fieldName)) { + deserializedMongoDbObjectInfo.name = reader.getString(); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbObjectInfo.qualifiedName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbObjectInfo; + }); + } +} 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 000000000000..134e135648a3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java @@ -0,0 +1,524 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * Base class for MongoDB migration outputs. + */ +@Fluent +public class MongoDbProgress implements JsonSerializable { + /* + * The type of progress object + */ + private MongoDbProgressResultType resultType = MongoDbProgressResultType.fromString("MongoDbProgress"); + + /* + * The number of document bytes copied during the Copying stage + */ + private long bytesCopied; + + /* + * The number of documents copied during the Copying stage + */ + private long documentsCopied; + + /* + * The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format) + */ + private String elapsedTime; + + /* + * The errors and warnings that have occurred for the current object. The keys are the error codes. + */ + private Map errors; + + /* + * The number of oplog events awaiting replay + */ + private long eventsPending; + + /* + * The number of oplog events replayed so far + */ + private long eventsReplayed; + + /* + * The timestamp of the last oplog event received, or null if no oplog event has been received yet + */ + private OffsetDateTime lastEventTime; + + /* + * The timestamp of the last oplog event replayed, or null if no oplog event has been replayed yet + */ + 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. + */ + 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. + */ + private String qualifiedName; + + /* + * The state property. + */ + 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 + */ + 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 + */ + private long totalDocuments; + + /** + * Creates an instance of MongoDbProgress class. + */ + public MongoDbProgress() { + } + + /** + * Get the resultType property: The type of progress object. + * + * @return the resultType value. + */ + public MongoDbProgressResultType resultType() { + return this.resultType; + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property elapsedTime in model MongoDbProgress")); + } + if (errors() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property errors in model MongoDbProgress")); + } else { + errors().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model MongoDbProgress")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbProgress.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("bytesCopied", this.bytesCopied); + jsonWriter.writeLongField("documentsCopied", this.documentsCopied); + jsonWriter.writeStringField("elapsedTime", this.elapsedTime); + jsonWriter.writeMapField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeLongField("eventsPending", this.eventsPending); + jsonWriter.writeLongField("eventsReplayed", this.eventsReplayed); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeLongField("totalBytes", this.totalBytes); + jsonWriter.writeLongField("totalDocuments", this.totalDocuments); + jsonWriter.writeStringField("resultType", this.resultType == null ? null : this.resultType.toString()); + jsonWriter.writeStringField("lastEventTime", + this.lastEventTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastEventTime)); + jsonWriter.writeStringField("lastReplayTime", + this.lastReplayTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastReplayTime)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("qualifiedName", this.qualifiedName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbProgress if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbProgress. + */ + public static MongoDbProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resultType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Collection".equals(discriminatorValue)) { + return MongoDbCollectionProgress.fromJson(readerToUse.reset()); + } else if ("Database".equals(discriminatorValue)) { + return MongoDbDatabaseProgress.fromJson(readerToUse.reset()); + } else if ("Migration".equals(discriminatorValue)) { + return MongoDbMigrationProgress.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static MongoDbProgress fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbProgress deserializedMongoDbProgress = new MongoDbProgress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bytesCopied".equals(fieldName)) { + deserializedMongoDbProgress.bytesCopied = reader.getLong(); + } else if ("documentsCopied".equals(fieldName)) { + deserializedMongoDbProgress.documentsCopied = reader.getLong(); + } else if ("elapsedTime".equals(fieldName)) { + deserializedMongoDbProgress.elapsedTime = reader.getString(); + } else if ("errors".equals(fieldName)) { + Map errors = reader.readMap(reader1 -> MongoDbError.fromJson(reader1)); + deserializedMongoDbProgress.errors = errors; + } else if ("eventsPending".equals(fieldName)) { + deserializedMongoDbProgress.eventsPending = reader.getLong(); + } else if ("eventsReplayed".equals(fieldName)) { + deserializedMongoDbProgress.eventsReplayed = reader.getLong(); + } else if ("state".equals(fieldName)) { + deserializedMongoDbProgress.state = MongoDbMigrationState.fromString(reader.getString()); + } else if ("totalBytes".equals(fieldName)) { + deserializedMongoDbProgress.totalBytes = reader.getLong(); + } else if ("totalDocuments".equals(fieldName)) { + deserializedMongoDbProgress.totalDocuments = reader.getLong(); + } else if ("resultType".equals(fieldName)) { + deserializedMongoDbProgress.resultType = MongoDbProgressResultType.fromString(reader.getString()); + } else if ("lastEventTime".equals(fieldName)) { + deserializedMongoDbProgress.lastEventTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastReplayTime".equals(fieldName)) { + deserializedMongoDbProgress.lastReplayTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedMongoDbProgress.name = reader.getString(); + } else if ("qualifiedName".equals(fieldName)) { + deserializedMongoDbProgress.qualifiedName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbProgress; + }); + } +} 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 000000000000..df8a27d2e815 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of progress object. + */ +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 a new instance of MongoDbProgressResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbProgressResultType() { + } + + /** + * Creates or finds a MongoDbProgressResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbProgressResultType. + */ + public static MongoDbProgressResultType fromString(String name) { + return fromString(name, MongoDbProgressResultType.class); + } + + /** + * Gets known MongoDbProgressResultType values. + * + * @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 000000000000..700cd9f38588 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes how changes will be replicated from the source to the target. The default is OneTime. + */ +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 a new instance of MongoDbReplication value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbReplication() { + } + + /** + * Creates or finds a MongoDbReplication from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbReplication. + */ + public static MongoDbReplication fromString(String name) { + return fromString(name, MongoDbReplication.class); + } + + /** + * Gets known MongoDbReplication values. + * + * @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 000000000000..6b24454d3528 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; + +/** + * Properties for the command that restarts a migration in whole or in part. + */ +@Fluent +public final class MongoDbRestartCommand extends CommandPropertiesInner { + /* + * Command type. + */ + private CommandType commandType = CommandType.RESTART; + + /* + * Command input + */ + private MongoDbCommandInput input; + + /* + * The state of the command. This is ignored if submitted. + */ + private CommandState state; + + /* + * Array of errors. This is ignored if submitted. + */ + private List errors; + + /** + * Creates an instance of MongoDbRestartCommand class. + */ + public MongoDbRestartCommand() { + } + + /** + * Get the commandType property: Command type. + * + * @return the commandType value. + */ + @Override + public CommandType commandType() { + return this.commandType; + } + + /** + * 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; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + @Override + public CommandState state() { + return this.state; + } + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + @Override + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (input() != null) { + input().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commandType", this.commandType == null ? null : this.commandType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbRestartCommand from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbRestartCommand if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbRestartCommand. + */ + public static MongoDbRestartCommand fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbRestartCommand deserializedMongoDbRestartCommand = new MongoDbRestartCommand(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedMongoDbRestartCommand.errors = errors; + } else if ("state".equals(fieldName)) { + deserializedMongoDbRestartCommand.state = CommandState.fromString(reader.getString()); + } else if ("commandType".equals(fieldName)) { + deserializedMongoDbRestartCommand.commandType = CommandType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedMongoDbRestartCommand.input = MongoDbCommandInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbRestartCommand; + }); + } +} 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 000000000000..e8374b772212 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a field reference within a MongoDB shard key. + */ +@Fluent +public final class MongoDbShardKeyField implements JsonSerializable { + /* + * The name of the field + */ + private String name; + + /* + * The field ordering + */ + private MongoDbShardKeyOrder order; + + /** + * Creates an instance of MongoDbShardKeyField class. + */ + public MongoDbShardKeyField() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property name in model MongoDbShardKeyField")); + } + if (order() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property order in model MongoDbShardKeyField")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeyField.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("order", this.order == null ? null : this.order.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbShardKeyField from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbShardKeyField if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbShardKeyField. + */ + public static MongoDbShardKeyField fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbShardKeyField deserializedMongoDbShardKeyField = new MongoDbShardKeyField(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMongoDbShardKeyField.name = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedMongoDbShardKeyField.order = MongoDbShardKeyOrder.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbShardKeyField; + }); + } +} 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 000000000000..4c42cc8437d4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a MongoDB shard key. + */ +@Fluent +public final class MongoDbShardKeyInfo implements JsonSerializable { + /* + * The fields within the shard key + */ + private List fields; + + /* + * Whether the shard key is unique + */ + private boolean isUnique; + + /** + * Creates an instance of MongoDbShardKeyInfo class. + */ + public MongoDbShardKeyInfo() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property fields in model MongoDbShardKeyInfo")); + } else { + fields().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeyInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fields", this.fields, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isUnique", this.isUnique); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbShardKeyInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbShardKeyInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbShardKeyInfo. + */ + public static MongoDbShardKeyInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbShardKeyInfo deserializedMongoDbShardKeyInfo = new MongoDbShardKeyInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fields".equals(fieldName)) { + List fields + = reader.readArray(reader1 -> MongoDbShardKeyField.fromJson(reader1)); + deserializedMongoDbShardKeyInfo.fields = fields; + } else if ("isUnique".equals(fieldName)) { + deserializedMongoDbShardKeyInfo.isUnique = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbShardKeyInfo; + }); + } +} 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 000000000000..b1b28420d623 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The field ordering. + */ +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 a new instance of MongoDbShardKeyOrder value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoDbShardKeyOrder() { + } + + /** + * Creates or finds a MongoDbShardKeyOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbShardKeyOrder. + */ + public static MongoDbShardKeyOrder fromString(String name) { + return fromString(name, MongoDbShardKeyOrder.class); + } + + /** + * Gets known MongoDbShardKeyOrder values. + * + * @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 000000000000..bc37cb744f98 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes a MongoDB shard key. + */ +@Fluent +public final class MongoDbShardKeySetting implements JsonSerializable { + /* + * The fields within the shard key + */ + private List fields; + + /* + * Whether the shard key is unique + */ + private Boolean isUnique; + + /** + * Creates an instance of MongoDbShardKeySetting class. + */ + public MongoDbShardKeySetting() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property fields in model MongoDbShardKeySetting")); + } else { + fields().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoDbShardKeySetting.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("fields", this.fields, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isUnique", this.isUnique); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbShardKeySetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbShardKeySetting if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoDbShardKeySetting. + */ + public static MongoDbShardKeySetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbShardKeySetting deserializedMongoDbShardKeySetting = new MongoDbShardKeySetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fields".equals(fieldName)) { + List fields + = reader.readArray(reader1 -> MongoDbShardKeyField.fromJson(reader1)); + deserializedMongoDbShardKeySetting.fields = fields; + } else if ("isUnique".equals(fieldName)) { + deserializedMongoDbShardKeySetting.isUnique = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbShardKeySetting; + }); + } +} 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 000000000000..805ee576c626 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies resource limits for the migration. + */ +@Fluent +public final class MongoDbThrottlingSettings implements JsonSerializable { + /* + * The percentage of CPU time that the migrator will try to avoid using, from 0 to 100 + */ + private Integer minFreeCpu; + + /* + * The number of megabytes of RAM that the migrator will try to avoid using + */ + private Integer minFreeMemoryMb; + + /* + * The maximum number of work items (e.g. collection copies) that will be processed in parallel + */ + private Integer maxParallelism; + + /** + * Creates an instance of MongoDbThrottlingSettings class. + */ + public MongoDbThrottlingSettings() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minFreeCpu", this.minFreeCpu); + jsonWriter.writeNumberField("minFreeMemoryMb", this.minFreeMemoryMb); + jsonWriter.writeNumberField("maxParallelism", this.maxParallelism); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoDbThrottlingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoDbThrottlingSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoDbThrottlingSettings. + */ + public static MongoDbThrottlingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoDbThrottlingSettings deserializedMongoDbThrottlingSettings = new MongoDbThrottlingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minFreeCpu".equals(fieldName)) { + deserializedMongoDbThrottlingSettings.minFreeCpu = reader.getNullable(JsonReader::getInt); + } else if ("minFreeMemoryMb".equals(fieldName)) { + deserializedMongoDbThrottlingSettings.minFreeMemoryMb = reader.getNullable(JsonReader::getInt); + } else if ("maxParallelism".equals(fieldName)) { + deserializedMongoDbThrottlingSettings.maxParallelism = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoDbThrottlingSettings; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationCollection.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationCollection.java new file mode 100644 index 000000000000..4c08c3cfdb88 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationCollection.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Mongo source and target database and collection details. + */ +@Fluent +public final class MongoMigrationCollection implements JsonSerializable { + /* + * Source database name. + */ + private String sourceDatabase; + + /* + * Source collection name. + */ + private String sourceCollection; + + /* + * Target database name. + */ + private String targetDatabase; + + /* + * Target collection name. + */ + private String targetCollection; + + /* + * Detailed migration status. Not included by default. + */ + private MongoMigrationProgressDetails migrationProgressDetails; + + /** + * Creates an instance of MongoMigrationCollection class. + */ + public MongoMigrationCollection() { + } + + /** + * Get the sourceDatabase property: Source database name. + * + * @return the sourceDatabase value. + */ + public String sourceDatabase() { + return this.sourceDatabase; + } + + /** + * Set the sourceDatabase property: Source database name. + * + * @param sourceDatabase the sourceDatabase value to set. + * @return the MongoMigrationCollection object itself. + */ + public MongoMigrationCollection withSourceDatabase(String sourceDatabase) { + this.sourceDatabase = sourceDatabase; + return this; + } + + /** + * Get the sourceCollection property: Source collection name. + * + * @return the sourceCollection value. + */ + public String sourceCollection() { + return this.sourceCollection; + } + + /** + * Set the sourceCollection property: Source collection name. + * + * @param sourceCollection the sourceCollection value to set. + * @return the MongoMigrationCollection object itself. + */ + public MongoMigrationCollection withSourceCollection(String sourceCollection) { + this.sourceCollection = sourceCollection; + return this; + } + + /** + * Get the targetDatabase property: Target database name. + * + * @return the targetDatabase value. + */ + public String targetDatabase() { + return this.targetDatabase; + } + + /** + * Set the targetDatabase property: Target database name. + * + * @param targetDatabase the targetDatabase value to set. + * @return the MongoMigrationCollection object itself. + */ + public MongoMigrationCollection withTargetDatabase(String targetDatabase) { + this.targetDatabase = targetDatabase; + return this; + } + + /** + * Get the targetCollection property: Target collection name. + * + * @return the targetCollection value. + */ + public String targetCollection() { + return this.targetCollection; + } + + /** + * Set the targetCollection property: Target collection name. + * + * @param targetCollection the targetCollection value to set. + * @return the MongoMigrationCollection object itself. + */ + public MongoMigrationCollection withTargetCollection(String targetCollection) { + this.targetCollection = targetCollection; + return this; + } + + /** + * Get the migrationProgressDetails property: Detailed migration status. Not included by default. + * + * @return the migrationProgressDetails value. + */ + public MongoMigrationProgressDetails migrationProgressDetails() { + return this.migrationProgressDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationProgressDetails() != null) { + migrationProgressDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceDatabase", this.sourceDatabase); + jsonWriter.writeStringField("sourceCollection", this.sourceCollection); + jsonWriter.writeStringField("targetDatabase", this.targetDatabase); + jsonWriter.writeStringField("targetCollection", this.targetCollection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMigrationCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMigrationCollection if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoMigrationCollection. + */ + public static MongoMigrationCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMigrationCollection deserializedMongoMigrationCollection = new MongoMigrationCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceDatabase".equals(fieldName)) { + deserializedMongoMigrationCollection.sourceDatabase = reader.getString(); + } else if ("sourceCollection".equals(fieldName)) { + deserializedMongoMigrationCollection.sourceCollection = reader.getString(); + } else if ("targetDatabase".equals(fieldName)) { + deserializedMongoMigrationCollection.targetDatabase = reader.getString(); + } else if ("targetCollection".equals(fieldName)) { + deserializedMongoMigrationCollection.targetCollection = reader.getString(); + } else if ("migrationProgressDetails".equals(fieldName)) { + deserializedMongoMigrationCollection.migrationProgressDetails + = MongoMigrationProgressDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMigrationCollection; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationProgressDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationProgressDetails.java new file mode 100644 index 000000000000..ca6d834eb1db --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationProgressDetails.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Detailed status of collection migration. + */ +@Immutable +public final class MongoMigrationProgressDetails implements JsonSerializable { + /* + * Migration Status + */ + private MongoMigrationStatus migrationStatus; + + /* + * Migration Error + */ + private String migrationError; + + /* + * Source Document Count + */ + private Long sourceDocumentCount; + + /* + * Processed Document Count + */ + private Long processedDocumentCount; + + /* + * Migration duration + */ + private Integer durationInSeconds; + + /** + * Creates an instance of MongoMigrationProgressDetails class. + */ + public MongoMigrationProgressDetails() { + } + + /** + * Get the migrationStatus property: Migration Status. + * + * @return the migrationStatus value. + */ + public MongoMigrationStatus migrationStatus() { + return this.migrationStatus; + } + + /** + * Get the migrationError property: Migration Error. + * + * @return the migrationError value. + */ + public String migrationError() { + return this.migrationError; + } + + /** + * Get the sourceDocumentCount property: Source Document Count. + * + * @return the sourceDocumentCount value. + */ + public Long sourceDocumentCount() { + return this.sourceDocumentCount; + } + + /** + * Get the processedDocumentCount property: Processed Document Count. + * + * @return the processedDocumentCount value. + */ + public Long processedDocumentCount() { + return this.processedDocumentCount; + } + + /** + * Get the durationInSeconds property: Migration duration. + * + * @return the durationInSeconds value. + */ + public Integer durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMigrationProgressDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMigrationProgressDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoMigrationProgressDetails. + */ + public static MongoMigrationProgressDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMigrationProgressDetails deserializedMongoMigrationProgressDetails + = new MongoMigrationProgressDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationStatus".equals(fieldName)) { + deserializedMongoMigrationProgressDetails.migrationStatus + = MongoMigrationStatus.fromString(reader.getString()); + } else if ("migrationError".equals(fieldName)) { + deserializedMongoMigrationProgressDetails.migrationError = reader.getString(); + } else if ("sourceDocumentCount".equals(fieldName)) { + deserializedMongoMigrationProgressDetails.sourceDocumentCount + = reader.getNullable(JsonReader::getLong); + } else if ("processedDocumentCount".equals(fieldName)) { + deserializedMongoMigrationProgressDetails.processedDocumentCount + = reader.getNullable(JsonReader::getLong); + } else if ("durationInSeconds".equals(fieldName)) { + deserializedMongoMigrationProgressDetails.durationInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMigrationProgressDetails; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationStatus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationStatus.java new file mode 100644 index 000000000000..c8c8bf2a67df --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoMigrationStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights 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 java.util.Collection; + +/** + * Migration Status. + */ +public final class MongoMigrationStatus extends ExpandableStringEnum { + /** + * Static value NotStarted for MongoMigrationStatus. + */ + public static final MongoMigrationStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Static value InProgress for MongoMigrationStatus. + */ + public static final MongoMigrationStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Completed for MongoMigrationStatus. + */ + public static final MongoMigrationStatus COMPLETED = fromString("Completed"); + + /** + * Static value Failed for MongoMigrationStatus. + */ + public static final MongoMigrationStatus FAILED = fromString("Failed"); + + /** + * Static value Canceled for MongoMigrationStatus. + */ + public static final MongoMigrationStatus CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of MongoMigrationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MongoMigrationStatus() { + } + + /** + * Creates or finds a MongoMigrationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoMigrationStatus. + */ + public static MongoMigrationStatus fromString(String name) { + return fromString(name, MongoMigrationStatus.class); + } + + /** + * Gets known MongoMigrationStatus values. + * + * @return known MongoMigrationStatus values. + */ + public static Collection values() { + return values(MongoMigrationStatus.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java index 8e65edbeb557..b629a2a869ff 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java @@ -26,11 +26,31 @@ public final class MySqlConnectionInfo extends ConnectionInfo { */ private String serverName; + /* + * Data source + */ + private String dataSource; + /* * Port for Server */ private int port; + /* + * Whether to encrypt the connection + */ + private Boolean encryptConnection; + + /* + * Authentication type to use for connection + */ + private AuthenticationType authentication; + + /* + * Additional connection settings + */ + private String additionalSettings; + /** * Creates an instance of MySqlConnectionInfo class. */ @@ -67,6 +87,26 @@ public MySqlConnectionInfo withServerName(String serverName) { return this; } + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + /** * Get the port property: Port for Server. * @@ -87,6 +127,66 @@ public MySqlConnectionInfo withPort(int port) { return this; } + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + /** * {@inheritDoc} */ @@ -131,6 +231,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("serverName", this.serverName); jsonWriter.writeIntField("port", this.port); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("dataSource", this.dataSource); + jsonWriter.writeBooleanField("encryptConnection", this.encryptConnection); + jsonWriter.writeStringField("authentication", + this.authentication == null ? null : this.authentication.toString()); + jsonWriter.writeStringField("additionalSettings", this.additionalSettings); return jsonWriter.writeEndObject(); } @@ -160,6 +265,14 @@ public static MySqlConnectionInfo fromJson(JsonReader jsonReader) throws IOExcep deserializedMySqlConnectionInfo.port = reader.getInt(); } else if ("type".equals(fieldName)) { deserializedMySqlConnectionInfo.type = reader.getString(); + } else if ("dataSource".equals(fieldName)) { + deserializedMySqlConnectionInfo.dataSource = reader.getString(); + } else if ("encryptConnection".equals(fieldName)) { + deserializedMySqlConnectionInfo.encryptConnection = reader.getNullable(JsonReader::getBoolean); + } else if ("authentication".equals(fieldName)) { + deserializedMySqlConnectionInfo.authentication = AuthenticationType.fromString(reader.getString()); + } else if ("additionalSettings".equals(fieldName)) { + deserializedMySqlConnectionInfo.additionalSettings = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java new file mode 100644 index 000000000000..7efbe27f576e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NodeMonitoringData.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The NodeMonitoringData model. + */ +@Immutable +public final class NodeMonitoringData implements JsonSerializable { + /* + * Unmatched properties from the message are deserialized in this collection. + */ + private Map additionalProperties; + + /* + * Name of the integration runtime node. + */ + private String nodeName; + + /* + * Available memory (MB) on the integration runtime node. + */ + private Integer availableMemoryInMB; + + /* + * CPU percentage on the integration runtime node. + */ + private Integer cpuUtilization; + + /* + * Maximum concurrent jobs on the integration runtime node. + */ + private Integer concurrentJobsLimit; + + /* + * The number of jobs currently running on the integration runtime node. + */ + private Integer concurrentJobsRunning; + + /* + * The maximum concurrent jobs in this integration runtime. + */ + private Integer maxConcurrentJobs; + + /* + * Sent bytes on the integration runtime node. + */ + private Double sentBytes; + + /* + * Received bytes on the integration runtime node. + */ + private Double receivedBytes; + + /** + * Creates an instance of NodeMonitoringData class. + */ + public NodeMonitoringData() { + } + + /** + * Get the additionalProperties property: Unmatched properties from the message are deserialized in this collection. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Get the nodeName property: Name of the integration runtime node. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Get the availableMemoryInMB property: Available memory (MB) on the integration runtime node. + * + * @return the availableMemoryInMB value. + */ + public Integer availableMemoryInMB() { + return this.availableMemoryInMB; + } + + /** + * Get the cpuUtilization property: CPU percentage on the integration runtime node. + * + * @return the cpuUtilization value. + */ + public Integer cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the concurrentJobsLimit property: Maximum concurrent jobs on the integration runtime node. + * + * @return the concurrentJobsLimit value. + */ + public Integer concurrentJobsLimit() { + return this.concurrentJobsLimit; + } + + /** + * Get the concurrentJobsRunning property: The number of jobs currently running on the integration runtime node. + * + * @return the concurrentJobsRunning value. + */ + public Integer concurrentJobsRunning() { + return this.concurrentJobsRunning; + } + + /** + * Get the maxConcurrentJobs property: The maximum concurrent jobs in this integration runtime. + * + * @return the maxConcurrentJobs value. + */ + public Integer maxConcurrentJobs() { + return this.maxConcurrentJobs; + } + + /** + * Get the sentBytes property: Sent bytes on the integration runtime node. + * + * @return the sentBytes value. + */ + public Double sentBytes() { + return this.sentBytes; + } + + /** + * Get the receivedBytes property: Received bytes on the integration runtime node. + * + * @return the receivedBytes value. + */ + public Double receivedBytes() { + return this.receivedBytes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NodeMonitoringData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NodeMonitoringData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NodeMonitoringData. + */ + public static NodeMonitoringData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NodeMonitoringData deserializedNodeMonitoringData = new NodeMonitoringData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalProperties".equals(fieldName)) { + Map additionalProperties = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedNodeMonitoringData.additionalProperties = additionalProperties; + } else if ("nodeName".equals(fieldName)) { + deserializedNodeMonitoringData.nodeName = reader.getString(); + } else if ("availableMemoryInMB".equals(fieldName)) { + deserializedNodeMonitoringData.availableMemoryInMB = reader.getNullable(JsonReader::getInt); + } else if ("cpuUtilization".equals(fieldName)) { + deserializedNodeMonitoringData.cpuUtilization = reader.getNullable(JsonReader::getInt); + } else if ("concurrentJobsLimit".equals(fieldName)) { + deserializedNodeMonitoringData.concurrentJobsLimit = reader.getNullable(JsonReader::getInt); + } else if ("concurrentJobsRunning".equals(fieldName)) { + deserializedNodeMonitoringData.concurrentJobsRunning = reader.getNullable(JsonReader::getInt); + } else if ("maxConcurrentJobs".equals(fieldName)) { + deserializedNodeMonitoringData.maxConcurrentJobs = reader.getNullable(JsonReader::getInt); + } else if ("sentBytes".equals(fieldName)) { + deserializedNodeMonitoringData.sentBytes = reader.getNullable(JsonReader::getDouble); + } else if ("receivedBytes".equals(fieldName)) { + deserializedNodeMonitoringData.receivedBytes = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedNodeMonitoringData; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java new file mode 100644 index 000000000000..cadc29e8562a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OfflineConfiguration.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Offline configuration. + */ +@Fluent +public final class OfflineConfiguration implements JsonSerializable { + /* + * Offline migration + */ + private Boolean offline; + + /* + * Last backup name for offline migration. This is optional for migrations from file share. If it is not provided, + * then the service will determine the last backup file name based on latest backup files present in file share. + */ + private String lastBackupName; + + /** + * Creates an instance of OfflineConfiguration class. + */ + public OfflineConfiguration() { + } + + /** + * Get the offline property: Offline migration. + * + * @return the offline value. + */ + public Boolean offline() { + return this.offline; + } + + /** + * Set the offline property: Offline migration. + * + * @param offline the offline value to set. + * @return the OfflineConfiguration object itself. + */ + public OfflineConfiguration withOffline(Boolean offline) { + this.offline = offline; + return this; + } + + /** + * Get the lastBackupName property: Last backup name for offline migration. This is optional for migrations from + * file share. If it is not provided, then the service will determine the last backup file name based on latest + * backup files present in file share. + * + * @return the lastBackupName value. + */ + public String lastBackupName() { + return this.lastBackupName; + } + + /** + * Set the lastBackupName property: Last backup name for offline migration. This is optional for migrations from + * file share. If it is not provided, then the service will determine the last backup file name based on latest + * backup files present in file share. + * + * @param lastBackupName the lastBackupName value to set. + * @return the OfflineConfiguration object itself. + */ + public OfflineConfiguration withLastBackupName(String lastBackupName) { + this.lastBackupName = lastBackupName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("offline", this.offline); + jsonWriter.writeStringField("lastBackupName", this.lastBackupName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfflineConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfflineConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OfflineConfiguration. + */ + public static OfflineConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfflineConfiguration deserializedOfflineConfiguration = new OfflineConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offline".equals(fieldName)) { + deserializedOfflineConfiguration.offline = reader.getNullable(JsonReader::getBoolean); + } else if ("lastBackupName".equals(fieldName)) { + deserializedOfflineConfiguration.lastBackupName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOfflineConfiguration; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java new file mode 100644 index 000000000000..e7d37792e19b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list SQL operations. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OperationsDefinitionInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java new file mode 100644 index 000000000000..01e4fc17f53a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationOrigin.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for OperationOrigin. + */ +public final class OperationOrigin extends ExpandableStringEnum { + /** + * Static value user for OperationOrigin. + */ + public static final OperationOrigin USER = fromString("user"); + + /** + * Static value system for OperationOrigin. + */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** + * Creates a new instance of OperationOrigin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationOrigin() { + } + + /** + * Creates or finds a OperationOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationOrigin. + */ + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** + * Gets known OperationOrigin values. + * + * @return known OperationOrigin values. + */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java index e84b1d5b27c2..8deeb495715d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java @@ -12,26 +12,22 @@ */ public interface Operations { /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** - * Get available resource provider actions (operations) - * - * Lists all available actions exposed by the Database Migration Service resource provider. + * Lists all of the available SQL Migration REST API operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return oData page of action (operation) objects as paginated response with {@link PagedIterable}. + * @return result of the request to list SQL operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java new file mode 100644 index 000000000000..943433c31480 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDefinition.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner; +import java.util.Map; + +/** + * An immutable client-side representation of OperationsDefinition. + */ +public interface OperationsDefinition { + /** + * Gets the name property: The name property. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: The display property. + * + * @return the display value. + */ + OperationsDisplayDefinition display(); + + /** + * Gets the origin property: The origin property. + * + * @return the origin value. + */ + OperationOrigin origin(); + + /** + * Gets the properties property: Dictionary of <AnyObject>. + * + * @return the properties value. + */ + Map properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.OperationsDefinitionInner object. + * + * @return the inner object. + */ + OperationsDefinitionInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java new file mode 100644 index 000000000000..335b4f632704 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OperationsDisplayDefinition.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The OperationsDisplayDefinition model. + */ +@Immutable +public final class OperationsDisplayDefinition implements JsonSerializable { + /* + * The provider property. + */ + private String provider; + + /* + * The resource property. + */ + private String resource; + + /* + * The operation property. + */ + private String operation; + + /* + * The description property. + */ + private String description; + + /** + * Creates an instance of OperationsDisplayDefinition class. + */ + public OperationsDisplayDefinition() { + } + + /** + * Get the provider property: The provider property. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The operation property. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationsDisplayDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationsDisplayDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationsDisplayDefinition. + */ + public static OperationsDisplayDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationsDisplayDefinition deserializedOperationsDisplayDefinition = new OperationsDisplayDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationsDisplayDefinition.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationsDisplayDefinition.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationsDisplayDefinition.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationsDisplayDefinition.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationsDisplayDefinition; + }); + } +} 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 000000000000..341909de1a9a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information for connecting to Oracle server. + */ +@Fluent +public final class OracleConnectionInfo extends ConnectionInfo { + /* + * Type of connection info + */ + private String type = "OracleConnectionInfo"; + + /* + * EZConnect or TNSName connection string. + */ + private String dataSource; + + /* + * name of the server + */ + private String serverName; + + /* + * server version + */ + private String serverVersion; + + /* + * port for server + */ + private Integer port; + + /* + * Authentication type to use for connection + */ + private AuthenticationType authentication; + + /** + * Creates an instance of OracleConnectionInfo class. + */ + public OracleConnectionInfo() { + } + + /** + * Get the type property: Type of connection info. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the dataSource property: EZConnect or TNSName connection string. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: EZConnect or TNSName connection string. + * + * @param dataSource the dataSource value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the port property: port for server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: port for server. + * + * @param port the port value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OracleConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OracleConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (dataSource() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property dataSource in model OracleConnectionInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OracleConnectionInfo.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userName", username()); + jsonWriter.writeStringField("password", password()); + jsonWriter.writeStringField("dataSource", this.dataSource); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeStringField("serverVersion", this.serverVersion); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("authentication", + this.authentication == null ? null : this.authentication.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OracleConnectionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OracleConnectionInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OracleConnectionInfo. + */ + public static OracleConnectionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OracleConnectionInfo deserializedOracleConnectionInfo = new OracleConnectionInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userName".equals(fieldName)) { + deserializedOracleConnectionInfo.withUsername(reader.getString()); + } else if ("password".equals(fieldName)) { + deserializedOracleConnectionInfo.withPassword(reader.getString()); + } else if ("dataSource".equals(fieldName)) { + deserializedOracleConnectionInfo.dataSource = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOracleConnectionInfo.type = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedOracleConnectionInfo.serverName = reader.getString(); + } else if ("serverVersion".equals(fieldName)) { + deserializedOracleConnectionInfo.serverVersion = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedOracleConnectionInfo.port = reader.getNullable(JsonReader::getInt); + } else if ("authentication".equals(fieldName)) { + deserializedOracleConnectionInfo.authentication = AuthenticationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOracleConnectionInfo; + }); + } +} 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 000000000000..17c49e386104 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Information about an Oracle OCI driver. + */ +@Immutable +public final class OracleOciDriverInfo implements JsonSerializable { + /* + * The name of the driver package + */ + private String driverName; + + /* + * The size in bytes of the driver package + */ + private String driverSize; + + /* + * The MD5 Base64 encoded checksum for the driver package. + */ + private String archiveChecksum; + + /* + * The checksum for the driver package provided by Oracle. + */ + private String oracleChecksum; + + /* + * Version listed in the OCI assembly 'oci.dll' + */ + private String assemblyVersion; + + /* + * List of Oracle database versions supported by this driver. Only major minor of the version is listed. + */ + private List supportedOracleVersions; + + /** + * Creates an instance of OracleOciDriverInfo class. + */ + public OracleOciDriverInfo() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OracleOciDriverInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OracleOciDriverInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OracleOciDriverInfo. + */ + public static OracleOciDriverInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OracleOciDriverInfo deserializedOracleOciDriverInfo = new OracleOciDriverInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driverName".equals(fieldName)) { + deserializedOracleOciDriverInfo.driverName = reader.getString(); + } else if ("driverSize".equals(fieldName)) { + deserializedOracleOciDriverInfo.driverSize = reader.getString(); + } else if ("archiveChecksum".equals(fieldName)) { + deserializedOracleOciDriverInfo.archiveChecksum = reader.getString(); + } else if ("oracleChecksum".equals(fieldName)) { + deserializedOracleOciDriverInfo.oracleChecksum = reader.getString(); + } else if ("assemblyVersion".equals(fieldName)) { + deserializedOracleOciDriverInfo.assemblyVersion = reader.getString(); + } else if ("supportedOracleVersions".equals(fieldName)) { + List supportedOracleVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedOracleOciDriverInfo.supportedOracleVersions = supportedOracleVersions; + } else { + reader.skipChildren(); + } + } + + return deserializedOracleOciDriverInfo; + }); + } +} 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 393d3773e30d..2ea068bc6a41 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 @@ -26,6 +26,16 @@ public final class PostgreSqlConnectionInfo extends ConnectionInfo { */ private String serverName; + /* + * Data source + */ + private String dataSource; + + /* + * server version + */ + private String serverVersion; + /* * Name of the database */ @@ -36,6 +46,31 @@ public final class PostgreSqlConnectionInfo extends ConnectionInfo { */ private int port; + /* + * Whether to encrypt the connection + */ + private Boolean encryptConnection; + + /* + * Whether to trust the server certificate + */ + private Boolean trustServerCertificate; + + /* + * Additional connection settings + */ + private String additionalSettings; + + /* + * server brand version + */ + private String serverBrandVersion; + + /* + * Authentication type to use for connection + */ + private AuthenticationType authentication; + /** * Creates an instance of PostgreSqlConnectionInfo class. */ @@ -72,6 +107,46 @@ public PostgreSqlConnectionInfo withServerName(String serverName) { return this; } + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + /** * Get the databaseName property: Name of the database. * @@ -112,6 +187,106 @@ public PostgreSqlConnectionInfo withPort(int port) { return this; } + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + /** * {@inheritDoc} */ @@ -157,7 +332,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("serverName", this.serverName); jsonWriter.writeIntField("port", this.port); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("dataSource", this.dataSource); + jsonWriter.writeStringField("serverVersion", this.serverVersion); jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeBooleanField("encryptConnection", this.encryptConnection); + jsonWriter.writeBooleanField("trustServerCertificate", this.trustServerCertificate); + jsonWriter.writeStringField("additionalSettings", this.additionalSettings); + jsonWriter.writeStringField("serverBrandVersion", this.serverBrandVersion); + jsonWriter.writeStringField("authentication", + this.authentication == null ? null : this.authentication.toString()); return jsonWriter.writeEndObject(); } @@ -187,8 +370,24 @@ public static PostgreSqlConnectionInfo fromJson(JsonReader jsonReader) throws IO deserializedPostgreSqlConnectionInfo.port = reader.getInt(); } else if ("type".equals(fieldName)) { deserializedPostgreSqlConnectionInfo.type = reader.getString(); + } else if ("dataSource".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.dataSource = reader.getString(); + } else if ("serverVersion".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.serverVersion = reader.getString(); } else if ("databaseName".equals(fieldName)) { deserializedPostgreSqlConnectionInfo.databaseName = reader.getString(); + } else if ("encryptConnection".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.encryptConnection = reader.getNullable(JsonReader::getBoolean); + } else if ("trustServerCertificate".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.trustServerCertificate + = reader.getNullable(JsonReader::getBoolean); + } else if ("additionalSettings".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.additionalSettings = reader.getString(); + } else if ("serverBrandVersion".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.serverBrandVersion = reader.getString(); + } else if ("authentication".equals(fieldName)) { + deserializedPostgreSqlConnectionInfo.authentication + = AuthenticationType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java index bfb903b8918c..0619df873d4b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java @@ -50,6 +50,20 @@ public interface Project { */ Map tags(); + /** + * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + /** * Gets the sourcePlatform property: Source platform for the project. * @@ -57,6 +71,14 @@ public interface Project { */ ProjectSourcePlatform sourcePlatform(); + /** + * Gets the azureAuthenticationInfo property: Field that defines the Azure active directory application info, used + * to connect to the target Azure resource. + * + * @return the azureAuthenticationInfo value. + */ + AzureActiveDirectoryApp azureAuthenticationInfo(); + /** * Gets the targetPlatform property: Target platform for the project. * @@ -183,7 +205,8 @@ interface WithParentResource { * The stage of the Project definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSourcePlatform, + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithEtag, + DefinitionStages.WithSourcePlatform, DefinitionStages.WithAzureAuthenticationInfo, DefinitionStages.WithTargetPlatform, DefinitionStages.WithSourceConnectionInfo, DefinitionStages.WithTargetConnectionInfo, DefinitionStages.WithDatabasesInfo { /** @@ -215,6 +238,19 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the Project definition allowing to specify etag. + */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** * The stage of the Project definition allowing to specify sourcePlatform. */ @@ -228,6 +264,21 @@ interface WithSourcePlatform { WithCreate withSourcePlatform(ProjectSourcePlatform sourcePlatform); } + /** + * The stage of the Project definition allowing to specify azureAuthenticationInfo. + */ + interface WithAzureAuthenticationInfo { + /** + * Specifies the azureAuthenticationInfo property: Field that defines the Azure active directory application + * info, used to connect to the target Azure resource. + * + * @param azureAuthenticationInfo Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * @return the next definition stage. + */ + WithCreate withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo); + } + /** * The stage of the Project definition allowing to specify targetPlatform. */ @@ -291,7 +342,8 @@ interface WithDatabasesInfo { /** * The template for Project update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSourcePlatform, UpdateStages.WithTargetPlatform, + interface Update extends UpdateStages.WithTags, UpdateStages.WithEtag, UpdateStages.WithSourcePlatform, + UpdateStages.WithAzureAuthenticationInfo, UpdateStages.WithTargetPlatform, UpdateStages.WithSourceConnectionInfo, UpdateStages.WithTargetConnectionInfo, UpdateStages.WithDatabasesInfo { /** * Executes the update request. @@ -326,6 +378,19 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the Project update allowing to specify etag. + */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** * The stage of the Project update allowing to specify sourcePlatform. */ @@ -339,6 +404,21 @@ interface WithSourcePlatform { Update withSourcePlatform(ProjectSourcePlatform sourcePlatform); } + /** + * The stage of the Project update allowing to specify azureAuthenticationInfo. + */ + interface WithAzureAuthenticationInfo { + /** + * Specifies the azureAuthenticationInfo property: Field that defines the Azure active directory application + * info, used to connect to the target Azure resource. + * + * @param azureAuthenticationInfo Field that defines the Azure active directory application info, used to + * connect to the target Azure resource. + * @return the next definition stage. + */ + Update withAzureAuthenticationInfo(AzureActiveDirectoryApp azureAuthenticationInfo); + } + /** * The stage of the Project update allowing to specify targetPlatform. */ 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 000000000000..882eaaab939f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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); + + /** + * Request storage information for downloading the file content + * + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWithResponse(Context context); + + /** + * Request storage information for downloading the file content + * + * 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(); + + /** + * Request information for reading and writing file content. + * + * This method is used for requesting information for reading and writing the file content. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information along with {@link Response}. + */ + Response readWriteWithResponse(Context context); + + /** + * Request information for reading and writing file content. + * + * 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(); +} 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 000000000000..8d5f740199b4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Base class for file properties. + */ +@Fluent +public final class ProjectFileProperties implements JsonSerializable { + /* + * Optional File extension. If submitted it should not have a leading period and must match the extension from + * filePath. + */ + private String extension; + + /* + * Relative path of this file resource. This property can be set when creating or updating the file resource. + */ + private String filePath; + + /* + * Modification DateTime. + */ + private OffsetDateTime lastModified; + + /* + * File content type. This property can be modified to reflect the file content type. + */ + private String mediaType; + + /* + * File size. + */ + private Long size; + + /** + * Creates an instance of ProjectFileProperties class. + */ + public ProjectFileProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("extension", this.extension); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("mediaType", this.mediaType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectFileProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectFileProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectFileProperties. + */ + public static ProjectFileProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectFileProperties deserializedProjectFileProperties = new ProjectFileProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extension".equals(fieldName)) { + deserializedProjectFileProperties.extension = reader.getString(); + } else if ("filePath".equals(fieldName)) { + deserializedProjectFileProperties.filePath = reader.getString(); + } else if ("lastModified".equals(fieldName)) { + deserializedProjectFileProperties.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("mediaType".equals(fieldName)) { + deserializedProjectFileProperties.mediaType = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedProjectFileProperties.size = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectFileProperties; + }); + } +} 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 d72ffc9b48ad..851775381a82 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 @@ -16,6 +16,21 @@ public final class ProjectSourcePlatform extends ExpandableStringEnum commandWithResponse(CommandPropertiesInner parameters, Context context); + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties. + */ + CommandProperties command(CommandPropertiesInner parameters); } 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 ea9829b04af9..6fd4fbfe3f80 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,24 +4,27 @@ 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.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; 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. + * Base class for all types of DMS (classic) task properties. If task is not supported by current client, this object is + * returned. */ -@Immutable +@Fluent public class ProjectTaskProperties implements JsonSerializable { /* * Task type. */ - private String taskType = "ProjectTaskProperties"; + private TaskType taskType = TaskType.fromString("ProjectTaskProperties"); /* * Array of errors. This is ignored if submitted. @@ -36,7 +39,12 @@ public class ProjectTaskProperties implements JsonSerializable commands; + private List commands; + + /* + * Key value pairs of client data to attach meta data information to task + */ + private Map clientData; /** * Creates an instance of ProjectTaskProperties class. @@ -49,7 +57,7 @@ public ProjectTaskProperties() { * * @return the taskType value. */ - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -98,7 +106,7 @@ ProjectTaskProperties withState(TaskState state) { * * @return the commands value. */ - public List commands() { + public List commands() { return this.commands; } @@ -108,11 +116,31 @@ public List commands() { * @param commands the commands value to set. * @return the ProjectTaskProperties object itself. */ - ProjectTaskProperties withCommands(List commands) { + ProjectTaskProperties withCommands(List commands) { this.commands = commands; return this; } + /** + * 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. * @@ -130,7 +158,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeMapField("clientData", this.clientData, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -158,30 +187,52 @@ public static ProjectTaskProperties fromJson(JsonReader jsonReader) throws IOExc } } // Use the discriminator value to determine which subtype should be deserialized. - if ("ConnectToSource.MySql".equals(discriminatorValue)) { - return ConnectToSourceMySqlTaskProperties.fromJson(readerToUse.reset()); + if ("MigrateSchemaSqlServerSqlDb".equals(discriminatorValue)) { + return MigrateSchemaSqlServerSqlDbTaskProperties.fromJson(readerToUse.reset()); + } else if ("Service.Check.OCI".equals(discriminatorValue)) { + return CheckOciDriverTaskProperties.fromJson(readerToUse.reset()); + } else if ("Service.Upload.OCI".equals(discriminatorValue)) { + return UploadOciDriverTaskProperties.fromJson(readerToUse.reset()); + } else if ("Service.Install.OCI".equals(discriminatorValue)) { + return InstallOciDriverTaskProperties.fromJson(readerToUse.reset()); + } else if ("Connect.MongoDb".equals(discriminatorValue)) { + return ConnectToMongoDbTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToSource.SqlServer".equals(discriminatorValue)) { return ConnectToSourceSqlServerTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToSource.SqlServer.Sync".equals(discriminatorValue)) { return ConnectToSourceSqlServerSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToSource.PostgreSql.Sync".equals(discriminatorValue)) { return ConnectToSourcePostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); + } else if ("ConnectToSource.MySql".equals(discriminatorValue)) { + return ConnectToSourceMySqlTaskProperties.fromJson(readerToUse.reset()); + } else if ("ConnectToSource.Oracle.Sync".equals(discriminatorValue)) { + return ConnectToSourceOracleSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.SqlDb".equals(discriminatorValue)) { return ConnectToTargetSqlDbTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.SqlDb.Sync".equals(discriminatorValue)) { return ConnectToTargetSqlDbSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.AzureDbForPostgreSql.Sync".equals(discriminatorValue)) { return ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); + } else if ("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync".equals(discriminatorValue)) { + return ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("GetUserTables.Sql".equals(discriminatorValue)) { return GetUserTablesSqlTaskProperties.fromJson(readerToUse.reset()); } else if ("GetUserTables.AzureSqlDb.Sync".equals(discriminatorValue)) { return GetUserTablesSqlSyncTaskProperties.fromJson(readerToUse.reset()); + } else if ("GetUserTablesOracle".equals(discriminatorValue)) { + return GetUserTablesOracleTaskProperties.fromJson(readerToUse.reset()); + } else if ("GetUserTablesPostgreSql".equals(discriminatorValue)) { + return GetUserTablesPostgreSqlTaskProperties.fromJson(readerToUse.reset()); + } else if ("GetUserTablesMySql".equals(discriminatorValue)) { + return GetUserTablesMySqlTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.AzureSqlDbMI".equals(discriminatorValue)) { return ConnectToTargetSqlMITaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.AzureSqlDbMI.Sync.LRS".equals(discriminatorValue)) { return ConnectToTargetSqlMISyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ConnectToTarget.AzureDbForMySql".equals(discriminatorValue)) { return ConnectToTargetAzureDbForMySqlTaskProperties.fromJson(readerToUse.reset()); + } else if ("Migrate.MongoDb".equals(discriminatorValue)) { + return MigrateMongoDbTaskProperties.fromJson(readerToUse.reset()); } else if ("Migrate.SqlServer.AzureSqlDbMI".equals(discriminatorValue)) { return MigrateSqlServerSqlMITaskProperties.fromJson(readerToUse.reset()); } else if ("Migrate.SqlServer.AzureSqlDbMI.Sync.LRS".equals(discriminatorValue)) { @@ -192,16 +243,26 @@ public static ProjectTaskProperties fromJson(JsonReader jsonReader) throws IOExc return MigrateSqlServerSqlDbSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("Migrate.MySql.AzureDbForMySql.Sync".equals(discriminatorValue)) { return MigrateMySqlAzureDbForMySqlSyncTaskProperties.fromJson(readerToUse.reset()); - } else if ("Migrate.PostgreSql.AzureDbForPostgreSql.Sync".equals(discriminatorValue)) { + } else if ("Migrate.MySql.AzureDbForMySql".equals(discriminatorValue)) { + return MigrateMySqlAzureDbForMySqlOfflineTaskProperties.fromJson(readerToUse.reset()); + } else if ("Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2".equals(discriminatorValue)) { return MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); + } else if ("Migrate.Oracle.AzureDbForPostgreSql.Sync".equals(discriminatorValue)) { + return MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ValidateMigrationInput.SqlServer.SqlDb.Sync".equals(discriminatorValue)) { return ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("ValidateMigrationInput.SqlServer.AzureSqlDbMI".equals(discriminatorValue)) { return ValidateMigrationInputSqlServerSqlMITaskProperties.fromJson(readerToUse.reset()); } else if ("ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS".equals(discriminatorValue)) { return ValidateMigrationInputSqlServerSqlMISyncTaskProperties.fromJson(readerToUse.reset()); + } else if ("Validate.MongoDb".equals(discriminatorValue)) { + return ValidateMongoDbTaskProperties.fromJson(readerToUse.reset()); + } else if ("Validate.Oracle.AzureDbPostgreSql.Sync".equals(discriminatorValue)) { + return ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.fromJson(readerToUse.reset()); } else if ("GetTDECertificates.Sql".equals(discriminatorValue)) { return GetTdeCertificatesSqlTaskProperties.fromJson(readerToUse.reset()); + } else if ("Migrate.Ssis".equals(discriminatorValue)) { + return MigrateSsisTaskProperties.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -217,15 +278,19 @@ static ProjectTaskProperties fromJsonKnownDiscriminator(JsonReader jsonReader) t reader.nextToken(); if ("taskType".equals(fieldName)) { - deserializedProjectTaskProperties.taskType = reader.getString(); + deserializedProjectTaskProperties.taskType = TaskType.fromString(reader.getString()); } else if ("errors".equals(fieldName)) { List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); deserializedProjectTaskProperties.errors = errors; } else if ("state".equals(fieldName)) { deserializedProjectTaskProperties.state = TaskState.fromString(reader.getString()); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedProjectTaskProperties.commands = commands; + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedProjectTaskProperties.clientData = clientData; } else { reader.skipChildren(); } 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 06c6dcfa9975..29eaba8d52f1 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 @@ -25,7 +25,7 @@ public interface Projects { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return oData page of project resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String groupName, String serviceName); + PagedIterable list(String groupName, String serviceName); /** * Get projects in a service @@ -41,7 +41,7 @@ public interface Projects { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return oData page of project resources as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String groupName, String serviceName, Context context); + PagedIterable list(String groupName, String serviceName, Context context); /** * Get project information diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProvisioningState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProvisioningState.java new file mode 100644 index 000000000000..a05c2c63a4aa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning State of migration. ProvisioningState as Succeeded implies that validations have been performed and + * migration has started. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} 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 f292164b321e..40c71576412b 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Results for query analysis comparison between the source and target. */ -@Immutable +@Fluent public final class QueryAnalysisValidationResult implements JsonSerializable { /* * List of queries executed and it's execution results in source and target @@ -41,6 +41,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. * @@ -50,6 +61,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. * @@ -70,6 +92,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("queryResults", this.queryResults); + jsonWriter.writeJsonField("validationErrors", this.validationErrors); return jsonWriter.writeEndObject(); } 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 2c9ae5c7a701..c5f7987d9f7d 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Describes query analysis results for execution in source and target. */ -@Immutable +@Fluent public final class QueryExecutionResult implements JsonSerializable { /* * Query text retrieved from the source server @@ -51,6 +51,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. * @@ -60,6 +71,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. * @@ -69,6 +91,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. * @@ -78,6 +111,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. * @@ -98,6 +142,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryText", this.queryText); + jsonWriter.writeNumberField("statementsInBatch", this.statementsInBatch); + jsonWriter.writeJsonField("sourceResult", this.sourceResult); + jsonWriter.writeJsonField("targetResult", this.targetResult); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.java new file mode 100644 index 000000000000..29f7b405fcd3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/RegenAuthKeys.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.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** + * An immutable client-side representation of RegenAuthKeys. + */ +public interface RegenAuthKeys { + /** + * Gets the keyName property: The name of authentication key to generate. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the authKey1 property: The first authentication key. + * + * @return the authKey1 value. + */ + String authKey1(); + + /** + * Gets the authKey2 property: The second authentication key. + * + * @return the authKey2 value. + */ + String authKey2(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner object. + * + * @return the inner object. + */ + RegenAuthKeysInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java new file mode 100644 index 000000000000..bbbe3633f2da --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Wrapper for replicate reported migration states. + */ +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 a new instance of ReplicateMigrationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicateMigrationState() { + } + + /** + * Creates or finds a ReplicateMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicateMigrationState. + */ + public static ReplicateMigrationState fromString(String name) { + return fromString(name, ReplicateMigrationState.class); + } + + /** + * Gets known ReplicateMigrationState values. + * + * @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 1d488c588e01..1278d0c6ba43 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 @@ -61,6 +61,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. * @@ -90,6 +101,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. * @@ -99,6 +121,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. * @@ -108,6 +141,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. * @@ -117,6 +161,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. * @@ -131,7 +186,12 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); jsonWriter.writeStringField("actionableMessage", this.actionableMessage); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("lineNumber", this.lineNumber); + jsonWriter.writeNumberField("hResult", this.hResult); + jsonWriter.writeStringField("stackTrace", this.stackTrace); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java index a14b330b3b14..6498f6f225f7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java @@ -26,7 +26,7 @@ public interface ResourceSku { String name(); /** - * Gets the tier property: Specifies the tier of DMS in a scale set. + * Gets the tier property: Specifies the tier of DMS (classic) in a scale set. * * @return the tier value. */ diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java index a27255e6134d..9f3396846ab1 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java @@ -14,24 +14,24 @@ public interface ResourceSkus { /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** * Get supported SKUs * - * The skus action returns the list of SKUs that DMS supports. + * The skus action returns the list of SKUs that DMS (classic) supports. * * @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 DMS List SKUs operation response as paginated response with {@link PagedIterable}. + * @return the DMS (classic) List SKUs operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java index f5490bfceaf0..514ff2a050f9 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java @@ -15,7 +15,7 @@ import java.util.List; /** - * The DMS List SKUs operation response. + * The DMS (classic) List SKUs operation response. */ @Fluent public final class ResourceSkusResult implements JsonSerializable { @@ -25,7 +25,8 @@ public final class ResourceSkusResult implements JsonSerializable value; /* - * The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the next page of DMS SKUs. + * The uri to fetch the next page of DMS (classic) SKUs. Call ListNext() with this to fetch the next page of DMS + * (classic) SKUs. */ private String nextLink; @@ -56,8 +57,8 @@ public ResourceSkusResult withValue(List value) { } /** - * Get the nextLink property: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the - * next page of DMS SKUs. + * Get the nextLink property: The uri to fetch the next page of DMS (classic) SKUs. Call ListNext() with this to + * fetch the next page of DMS (classic) SKUs. * * @return the nextLink value. */ @@ -66,8 +67,8 @@ public String nextLink() { } /** - * Set the nextLink property: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the - * next page of DMS SKUs. + * Set the nextLink property: The uri to fetch the next page of DMS (classic) SKUs. Call ListNext() with this to + * fetch the next page of DMS (classic) SKUs. * * @param nextLink the nextLink value to set. * @return the ResourceSkusResult object itself. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.java new file mode 100644 index 000000000000..f622fe8b9363 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceType.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 java.util.Collection; + +/** + * Defines values for ResourceType. + */ +public final class ResourceType extends ExpandableStringEnum { + /** + * Static value SqlMi for ResourceType. + */ + public static final ResourceType SQL_MI = fromString("SqlMi"); + + /** + * Static value SqlVm for ResourceType. + */ + public static final ResourceType SQL_VM = fromString("SqlVm"); + + /** + * Static value SqlDb for ResourceType. + */ + public static final ResourceType SQL_DB = fromString("SqlDb"); + + /** + * Static value MongoToCosmosDbMongo for ResourceType. + */ + public static final ResourceType MONGO_TO_COSMOS_DB_MONGO = fromString("MongoToCosmosDbMongo"); + + /** + * Creates a new instance of ResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceType() { + } + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java new file mode 100644 index 000000000000..d627b497213a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights 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 java.util.Collection; + +/** + * An enumeration of source type. + */ +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 a new instance of ScenarioSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScenarioSource() { + } + + /** + * Creates or finds a ScenarioSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioSource. + */ + public static ScenarioSource fromString(String name) { + return fromString(name, ScenarioSource.class); + } + + /** + * Gets known ScenarioSource values. + * + * @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 000000000000..d828ebe5a0f1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * An enumeration of target type. + */ +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 a new instance of ScenarioTarget value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScenarioTarget() { + } + + /** + * Creates or finds a ScenarioTarget from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioTarget. + */ + public static ScenarioTarget fromString(String name) { + return fromString(name, ScenarioTarget.class); + } + + /** + * Gets known ScenarioTarget values. + * + * @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 b9a7372ab590..cf623e360eee 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 @@ -52,6 +52,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. * @@ -61,6 +73,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. * @@ -121,6 +144,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("schemaDifferences", this.schemaDifferences); + jsonWriter.writeJsonField("validationErrors", this.validationErrors); jsonWriter.writeMapField("sourceDatabaseObjectCount", this.sourceDatabaseObjectCount, (writer, element) -> writer.writeLong(element)); jsonWriter.writeMapField("targetDatabaseObjectCount", this.targetDatabaseObjectCount, 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 ffe7a899dcf7..4336895f766d 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Description about the errors happen while performing migration validation. */ -@Immutable +@Fluent public final class SchemaComparisonValidationResultType implements JsonSerializable { /* @@ -47,6 +47,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). * @@ -56,6 +67,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. * @@ -65,6 +87,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. * @@ -79,6 +112,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("objectName", this.objectName); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + jsonWriter.writeStringField("updateAction", this.updateAction == null ? null : this.updateAction.toString()); return jsonWriter.writeEndObject(); } 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 000000000000..3b6335b615dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Option for how schema is extracted and applied to target. + */ +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 a new instance of SchemaMigrationOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SchemaMigrationOption() { + } + + /** + * Creates or finds a SchemaMigrationOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationOption. + */ + public static SchemaMigrationOption fromString(String name) { + return fromString(name, SchemaMigrationOption.class); + } + + /** + * Gets known SchemaMigrationOption values. + * + * @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 000000000000..10d63c438952 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for migrating schema from source to target. + */ +@Fluent +public final class SchemaMigrationSetting implements JsonSerializable { + /* + * Option on how to migrate the schema + */ + private SchemaMigrationOption schemaOption; + + /* + * Resource Identifier of a file resource containing the uploaded schema file + */ + private String fileId; + + /* + * Name of the file resource containing the uploaded schema file + */ + private String fileName; + + /** + * Creates an instance of SchemaMigrationSetting class. + */ + public SchemaMigrationSetting() { + } + + /** + * Get the schemaOption property: Option on how to migrate the schema. + * + * @return the schemaOption value. + */ + public SchemaMigrationOption schemaOption() { + return this.schemaOption; + } + + /** + * Set the schemaOption property: Option on how to migrate the schema. + * + * @param schemaOption the schemaOption value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withSchemaOption(SchemaMigrationOption schemaOption) { + this.schemaOption = schemaOption; + return this; + } + + /** + * Get the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @return the fileId value. + */ + public String fileId() { + return this.fileId; + } + + /** + * Set the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @param fileId the fileId value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileId(String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Get the fileName property: Name of the file resource containing the uploaded schema file. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: Name of the file resource containing the uploaded schema file. + * + * @param fileName the fileName value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("schemaOption", this.schemaOption == null ? null : this.schemaOption.toString()); + jsonWriter.writeStringField("fileId", this.fileId); + jsonWriter.writeStringField("fileName", this.fileName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemaMigrationSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemaMigrationSetting if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemaMigrationSetting. + */ + public static SchemaMigrationSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemaMigrationSetting deserializedSchemaMigrationSetting = new SchemaMigrationSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("schemaOption".equals(fieldName)) { + deserializedSchemaMigrationSetting.schemaOption + = SchemaMigrationOption.fromString(reader.getString()); + } else if ("fileId".equals(fieldName)) { + deserializedSchemaMigrationSetting.fileId = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedSchemaMigrationSetting.fileName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSchemaMigrationSetting; + }); + } +} 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 000000000000..86d26f382f81 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current stage of schema migration. + */ +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 a new instance of SchemaMigrationStage value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SchemaMigrationStage() { + } + + /** + * Creates or finds a SchemaMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationStage. + */ + public static SchemaMigrationStage fromString(String name) { + return fromString(name, SchemaMigrationStage.class); + } + + /** + * Gets known SchemaMigrationStage values. + * + * @return known SchemaMigrationStage values. + */ + public static Collection values() { + return values(SchemaMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java index 84c148bce473..949e3e601166 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java @@ -27,7 +27,12 @@ public enum ServerLevelPermissionsGroup { /** * Enum value MigrationFromMySQLToAzureDBForMySQL. */ - MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"); + MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"), + + /** + * Enum value MigrationFromSqlServerToAzureVM. + */ + MIGRATION_FROM_SQL_SERVER_TO_AZURE_VM("MigrationFromSqlServerToAzureVM"); /** * The actual serialized value for a ServerLevelPermissionsGroup instance. 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 111f9dd673b1..f6edd3a6bd42 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Server properties for Oracle, MySQL type source. + * Server properties for MySQL type source. */ @Immutable public final class ServerProperties implements JsonSerializable { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java deleted file mode 100644 index 828f1c3f2e5d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; - -/** - * An immutable client-side representation of ServiceOperation. - */ -public interface ServiceOperation { - /** - * Gets the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Localized display text. - * - * @return the display value. - */ - ServiceOperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner object. - * - * @return the inner object. - */ - ServiceOperationInner innerModel(); -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java deleted file mode 100644 index d716a3d5a113..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Localized display text. - */ -@Fluent -public final class ServiceOperationDisplay implements JsonSerializable { - /* - * The localized resource provider name - */ - private String provider; - - /* - * The localized resource type name - */ - private String resource; - - /* - * The localized operation name - */ - private String operation; - - /* - * The localized operation description - */ - private String description; - - /** - * Creates an instance of ServiceOperationDisplay class. - */ - public ServiceOperationDisplay() { - } - - /** - * Get the provider property: The localized resource provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: The localized resource provider name. - * - * @param provider the provider value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: The localized resource type name. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The localized resource type name. - * - * @param resource the resource value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: The localized operation name. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The localized operation name. - * - * @param operation the operation value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: The localized operation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The localized operation description. - * - * @param description the description value to set. - * @return the ServiceOperationDisplay object itself. - */ - public ServiceOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceOperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceOperationDisplay if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServiceOperationDisplay. - */ - public static ServiceOperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceOperationDisplay deserializedServiceOperationDisplay = new ServiceOperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedServiceOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedServiceOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedServiceOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedServiceOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServiceOperationDisplay; - }); - } -} 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 78fcf34d6c58..8304d5dd4d3a 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 @@ -22,7 +22,7 @@ public final class ServiceSku implements JsonSerializable { 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' */ private String tier; @@ -70,7 +70,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. */ @@ -79,7 +79,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 000000000000..9a91718619fd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.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.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 { + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName); + + /** + * Get service level tasks for a service + * + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service level tasks owned by a service resource. Some tasks may have a status of + * Unknown, which indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PUT method creates a new service task or updates an existing one, although since service tasks have + * no mutable custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response createOrUpdateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response getWithResponse(String groupName, String serviceName, String taskName, String expand, + Context context); + + /** + * Get service task information + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, + Context context); + + /** + * Delete service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. The PATCH method updates an existing service task, but since service tasks have no mutable custom + * properties, there is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response updateWithResponse(String groupName, String serviceName, String taskName, + ProjectTaskInner parameters, Context context); + + /** + * Create or update service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * instance. This method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource along with {@link Response}. + */ + Response cancelWithResponse(String groupName, String serviceName, String taskName, Context context); + + /** + * Cancel a service task + * + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) + * 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); +} 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 5a0dcad96b41..4209f18cff2d 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 @@ -13,10 +13,10 @@ */ public interface Services { /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -24,31 +24,31 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response}. */ Response getByResourceGroupWithResponse(String groupName, String serviceName, Context context); /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 a Database Migration Service resource. + * @return an Azure Database Migration Service (classic) resource. */ DataMigrationService getByResourceGroup(String groupName, String serviceName); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -59,10 +59,10 @@ Response getByResourceGroupWithResponse(String groupName, void delete(String groupName, String serviceName); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -77,8 +77,8 @@ Response getByResourceGroupWithResponse(String groupName, /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -94,8 +94,8 @@ Response checkStatusWithResponse(String grou /** * Check service health status * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * performs a health check and returns the status of the service and virtual machine size. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action performs a health check and returns the status of the service and virtual machine size. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -109,8 +109,8 @@ Response checkStatusWithResponse(String grou /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -123,8 +123,8 @@ Response checkStatusWithResponse(String grou /** * Start service * - * The services resource is the top-level resource that represents the Database Migration Service. This action - * starts the service and the service can be used for data migration. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action starts the service and the service can be used for data migration. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -138,9 +138,9 @@ Response checkStatusWithResponse(String grou /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -153,9 +153,9 @@ Response checkStatusWithResponse(String grou /** * Stop service * - * The services resource is the top-level resource that represents the Database Migration Service. This action stops - * the service and the service cannot be used for data migration. The service owner won't be billed when the service - * is stopped. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This action stops the service and the service cannot be used for data migration. The service owner won't be + * billed when the service is stopped. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -169,8 +169,8 @@ Response checkStatusWithResponse(String grou /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -184,8 +184,8 @@ Response checkStatusWithResponse(String grou /** * Get compatible SKUs * - * The services resource is the top-level resource that represents the Database Migration Service. The skus action - * returns the list of SKUs that a service resource can be updated to. + * The services resource is the top-level resource that represents the Database Migration Service (classic). The + * skus action returns the list of SKUs that a service resource can be updated to. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -211,7 +211,7 @@ Response checkStatusWithResponse(String grou * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return indicates whether a proposed resource name is available along with {@link Response}. */ - Response nestedCheckNameAvailabilityWithResponse(String groupName, String serviceName, + Response checkChildrenNameAvailabilityWithResponse(String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); /** @@ -227,14 +227,14 @@ Response nestedCheckNameAvailabilityWithResponse(Strin * @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(String groupName, String serviceName, + NameAvailabilityResponse checkChildrenNameAvailability(String groupName, String serviceName, NameAvailabilityRequest parameters); /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -247,8 +247,8 @@ NameAvailabilityResponse nestedCheckNameAvailability(String groupName, String se /** * Get services in resource group * - * The Services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a resource group. + * The Services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a resource group. * * @param groupName Name of the resource group. * @param context The context to associate with this operation. @@ -262,8 +262,8 @@ NameAvailabilityResponse nestedCheckNameAvailability(String groupName, String se /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -274,8 +274,8 @@ NameAvailabilityResponse nestedCheckNameAvailability(String groupName, String se /** * Get services in subscription * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of service resources in a subscription. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of service resources in a subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -316,39 +316,39 @@ Response checkNameAvailabilityWithResponse(String loca NameAvailabilityResponse checkNameAvailability(String location, NameAvailabilityRequest parameters); /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Database Migration Service resource along with {@link Response}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response}. */ DataMigrationService getById(String id); /** - * Get DMS Service Instance + * Get DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The GET method - * retrieves information about a service instance. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The GET method retrieves information about a service instance. * * @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 Database Migration Service resource along with {@link Response}. + * @return an Azure Database Migration Service (classic) resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,10 +358,10 @@ Response checkNameAvailabilityWithResponse(String loca void deleteById(String id); /** - * Delete DMS Service Instance + * Delete DMS (classic) Service Instance * - * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method - * deletes a service. Any running tasks will be canceled. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * The DELETE method deletes a service. Any running tasks will be canceled. * * @param id the resource ID. * @param deleteRunningTasks Delete the resource even if it contains running tasks. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java new file mode 100644 index 000000000000..fa1e380e57a6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SourceLocation.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source Location details of backups. + */ +@Fluent +public final class SourceLocation implements JsonSerializable { + /* + * Source File share. + */ + private SqlFileShare fileShare; + + /* + * Source Azure Blob. + */ + private AzureBlob azureBlob; + + /* + * Backup storage Type. + */ + private String fileStorageType; + + /** + * Creates an instance of SourceLocation class. + */ + public SourceLocation() { + } + + /** + * Get the fileShare property: Source File share. + * + * @return the fileShare value. + */ + public SqlFileShare fileShare() { + return this.fileShare; + } + + /** + * Set the fileShare property: Source File share. + * + * @param fileShare the fileShare value to set. + * @return the SourceLocation object itself. + */ + public SourceLocation withFileShare(SqlFileShare fileShare) { + this.fileShare = fileShare; + return this; + } + + /** + * Get the azureBlob property: Source Azure Blob. + * + * @return the azureBlob value. + */ + public AzureBlob azureBlob() { + return this.azureBlob; + } + + /** + * Set the azureBlob property: Source Azure Blob. + * + * @param azureBlob the azureBlob value to set. + * @return the SourceLocation object itself. + */ + public SourceLocation withAzureBlob(AzureBlob azureBlob) { + this.azureBlob = azureBlob; + return this; + } + + /** + * Get the fileStorageType property: Backup storage Type. + * + * @return the fileStorageType value. + */ + public String fileStorageType() { + return this.fileStorageType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileShare() != null) { + fileShare().validate(); + } + if (azureBlob() != null) { + azureBlob().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("fileShare", this.fileShare); + jsonWriter.writeJsonField("azureBlob", this.azureBlob); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceLocation. + */ + public static SourceLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceLocation deserializedSourceLocation = new SourceLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileShare".equals(fieldName)) { + deserializedSourceLocation.fileShare = SqlFileShare.fromJson(reader); + } else if ("azureBlob".equals(fieldName)) { + deserializedSourceLocation.azureBlob = AzureBlob.fromJson(reader); + } else if ("fileStorageType".equals(fieldName)) { + deserializedSourceLocation.fileStorageType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceLocation; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java new file mode 100644 index 000000000000..a2f4a69e6afa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupFileInfo.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information of backup file. + */ +@Immutable +public final class SqlBackupFileInfo implements JsonSerializable { + /* + * File name. + */ + private String fileName; + + /* + * Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped) + */ + private String status; + + /* + * File size in bytes + */ + private Long totalSize; + + /* + * Bytes read + */ + private Long dataRead; + + /* + * Bytes written + */ + private Long dataWritten; + + /* + * Copy throughput in KBps + */ + private Double copyThroughput; + + /* + * Copy Duration in seconds + */ + private Integer copyDuration; + + /* + * Media family sequence number + */ + private Integer familySequenceNumber; + + /** + * Creates an instance of SqlBackupFileInfo class. + */ + public SqlBackupFileInfo() { + } + + /** + * Get the fileName property: File name. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Get the status property: Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped). + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the totalSize property: File size in bytes. + * + * @return the totalSize value. + */ + public Long totalSize() { + return this.totalSize; + } + + /** + * Get the dataRead property: Bytes read. + * + * @return the dataRead value. + */ + public Long dataRead() { + return this.dataRead; + } + + /** + * Get the dataWritten property: Bytes written. + * + * @return the dataWritten value. + */ + public Long dataWritten() { + return this.dataWritten; + } + + /** + * Get the copyThroughput property: Copy throughput in KBps. + * + * @return the copyThroughput value. + */ + public Double copyThroughput() { + return this.copyThroughput; + } + + /** + * Get the copyDuration property: Copy Duration in seconds. + * + * @return the copyDuration value. + */ + public Integer copyDuration() { + return this.copyDuration; + } + + /** + * Get the familySequenceNumber property: Media family sequence number. + * + * @return the familySequenceNumber value. + */ + public Integer familySequenceNumber() { + return this.familySequenceNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlBackupFileInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlBackupFileInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlBackupFileInfo. + */ + public static SqlBackupFileInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlBackupFileInfo deserializedSqlBackupFileInfo = new SqlBackupFileInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + deserializedSqlBackupFileInfo.fileName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSqlBackupFileInfo.status = reader.getString(); + } else if ("totalSize".equals(fieldName)) { + deserializedSqlBackupFileInfo.totalSize = reader.getNullable(JsonReader::getLong); + } else if ("dataRead".equals(fieldName)) { + deserializedSqlBackupFileInfo.dataRead = reader.getNullable(JsonReader::getLong); + } else if ("dataWritten".equals(fieldName)) { + deserializedSqlBackupFileInfo.dataWritten = reader.getNullable(JsonReader::getLong); + } else if ("copyThroughput".equals(fieldName)) { + deserializedSqlBackupFileInfo.copyThroughput = reader.getNullable(JsonReader::getDouble); + } else if ("copyDuration".equals(fieldName)) { + deserializedSqlBackupFileInfo.copyDuration = reader.getNullable(JsonReader::getInt); + } else if ("familySequenceNumber".equals(fieldName)) { + deserializedSqlBackupFileInfo.familySequenceNumber = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlBackupFileInfo; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java new file mode 100644 index 000000000000..620b320aae73 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlBackupSetInfo.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** + * Information of backup set. + */ +@Immutable +public final class SqlBackupSetInfo implements JsonSerializable { + /* + * Backup set id. + */ + private UUID backupSetId; + + /* + * First LSN of the backup set. + */ + private String firstLsn; + + /* + * Last LSN of the backup set. + */ + private String lastLsn; + + /* + * Backup type. + */ + private String backupType; + + /* + * List of files in the backup set. + */ + private List listOfBackupFiles; + + /* + * Backup start date. + */ + private OffsetDateTime backupStartDate; + + /* + * Backup end time. + */ + private OffsetDateTime backupFinishDate; + + /* + * Whether this backup set has been restored or not. + */ + private Boolean isBackupRestored; + + /* + * Has Backup Checksums + */ + private Boolean hasBackupChecksums; + + /* + * Media family count + */ + private Integer familyCount; + + /* + * The reasons why the backup set is ignored + */ + private List ignoreReasons; + + /** + * Creates an instance of SqlBackupSetInfo class. + */ + public SqlBackupSetInfo() { + } + + /** + * Get the backupSetId property: Backup set id. + * + * @return the backupSetId value. + */ + public UUID backupSetId() { + return this.backupSetId; + } + + /** + * Get the firstLsn property: First LSN of the backup set. + * + * @return the firstLsn value. + */ + public String firstLsn() { + return this.firstLsn; + } + + /** + * Get the lastLsn property: Last LSN of the backup set. + * + * @return the lastLsn value. + */ + public String lastLsn() { + return this.lastLsn; + } + + /** + * Get the backupType property: Backup type. + * + * @return the backupType value. + */ + public String backupType() { + return this.backupType; + } + + /** + * Get the listOfBackupFiles property: List of files in the backup set. + * + * @return the listOfBackupFiles value. + */ + public List listOfBackupFiles() { + return this.listOfBackupFiles; + } + + /** + * Get the backupStartDate property: Backup start date. + * + * @return the backupStartDate value. + */ + public OffsetDateTime backupStartDate() { + return this.backupStartDate; + } + + /** + * Get the backupFinishDate property: Backup end time. + * + * @return the backupFinishDate value. + */ + public OffsetDateTime backupFinishDate() { + return this.backupFinishDate; + } + + /** + * Get the isBackupRestored property: Whether this backup set has been restored or not. + * + * @return the isBackupRestored value. + */ + public Boolean isBackupRestored() { + return this.isBackupRestored; + } + + /** + * Get the hasBackupChecksums property: Has Backup Checksums. + * + * @return the hasBackupChecksums value. + */ + public Boolean hasBackupChecksums() { + return this.hasBackupChecksums; + } + + /** + * Get the familyCount property: Media family count. + * + * @return the familyCount value. + */ + public Integer familyCount() { + return this.familyCount; + } + + /** + * Get the ignoreReasons property: The reasons why the backup set is ignored. + * + * @return the ignoreReasons value. + */ + public List ignoreReasons() { + return this.ignoreReasons; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listOfBackupFiles() != null) { + listOfBackupFiles().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlBackupSetInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlBackupSetInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlBackupSetInfo. + */ + public static SqlBackupSetInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlBackupSetInfo deserializedSqlBackupSetInfo = new SqlBackupSetInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupSetId".equals(fieldName)) { + deserializedSqlBackupSetInfo.backupSetId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("firstLSN".equals(fieldName)) { + deserializedSqlBackupSetInfo.firstLsn = reader.getString(); + } else if ("lastLSN".equals(fieldName)) { + deserializedSqlBackupSetInfo.lastLsn = reader.getString(); + } else if ("backupType".equals(fieldName)) { + deserializedSqlBackupSetInfo.backupType = reader.getString(); + } else if ("listOfBackupFiles".equals(fieldName)) { + List listOfBackupFiles + = reader.readArray(reader1 -> SqlBackupFileInfo.fromJson(reader1)); + deserializedSqlBackupSetInfo.listOfBackupFiles = listOfBackupFiles; + } else if ("backupStartDate".equals(fieldName)) { + deserializedSqlBackupSetInfo.backupStartDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupFinishDate".equals(fieldName)) { + deserializedSqlBackupSetInfo.backupFinishDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("isBackupRestored".equals(fieldName)) { + deserializedSqlBackupSetInfo.isBackupRestored = reader.getNullable(JsonReader::getBoolean); + } else if ("hasBackupChecksums".equals(fieldName)) { + deserializedSqlBackupSetInfo.hasBackupChecksums = reader.getNullable(JsonReader::getBoolean); + } else if ("familyCount".equals(fieldName)) { + deserializedSqlBackupSetInfo.familyCount = reader.getNullable(JsonReader::getInt); + } else if ("ignoreReasons".equals(fieldName)) { + List ignoreReasons = reader.readArray(reader1 -> reader1.getString()); + deserializedSqlBackupSetInfo.ignoreReasons = ignoreReasons; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlBackupSetInfo; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java index fa6a06bc936b..fc32a5405b1b 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java @@ -26,6 +26,31 @@ public final class SqlConnectionInfo extends ConnectionInfo { */ private String dataSource; + /* + * name of the server + */ + private String serverName; + + /* + * Port for Server + */ + private Integer port; + + /* + * server version + */ + private String serverVersion; + + /* + * server brand version + */ + private String serverBrandVersion; + + /* + * Represents the ID of an HTTP resource represented by an Azure resource provider. + */ + private String resourceId; + /* * Authentication type to use for connection */ @@ -87,6 +112,106 @@ public SqlConnectionInfo withDataSource(String dataSource) { return this; } + /** + * Get the serverName property: name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: name of the server. + * + * @param serverName the serverName value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the port property: Port for Server. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Port for Server. + * + * @param port the port value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the serverVersion property: server version. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: server version. + * + * @param serverVersion the serverVersion value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Get the serverBrandVersion property: server brand version. + * + * @return the serverBrandVersion value. + */ + public String serverBrandVersion() { + return this.serverBrandVersion; + } + + /** + * Set the serverBrandVersion property: server brand version. + * + * @param serverBrandVersion the serverBrandVersion value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withServerBrandVersion(String serverBrandVersion) { + this.serverBrandVersion = serverBrandVersion; + return this; + } + + /** + * Get the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Represents the ID of an HTTP resource represented by an Azure resource provider. + * + * @param resourceId the resourceId value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + /** * Get the authentication property: Authentication type to use for connection. * @@ -230,6 +355,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("password", password()); jsonWriter.writeStringField("dataSource", this.dataSource); jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("serverName", this.serverName); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("serverVersion", this.serverVersion); + jsonWriter.writeStringField("serverBrandVersion", this.serverBrandVersion); + jsonWriter.writeStringField("resourceId", this.resourceId); jsonWriter.writeStringField("authentication", this.authentication == null ? null : this.authentication.toString()); jsonWriter.writeBooleanField("encryptConnection", this.encryptConnection); @@ -263,6 +393,16 @@ public static SqlConnectionInfo fromJson(JsonReader jsonReader) throws IOExcepti deserializedSqlConnectionInfo.dataSource = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlConnectionInfo.type = reader.getString(); + } else if ("serverName".equals(fieldName)) { + deserializedSqlConnectionInfo.serverName = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedSqlConnectionInfo.port = reader.getNullable(JsonReader::getInt); + } else if ("serverVersion".equals(fieldName)) { + deserializedSqlConnectionInfo.serverVersion = reader.getString(); + } else if ("serverBrandVersion".equals(fieldName)) { + deserializedSqlConnectionInfo.serverBrandVersion = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedSqlConnectionInfo.resourceId = reader.getString(); } else if ("authentication".equals(fieldName)) { deserializedSqlConnectionInfo.authentication = AuthenticationType.fromString(reader.getString()); } else if ("encryptConnection".equals(fieldName)) { diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java new file mode 100644 index 000000000000..d474b5bd241c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInformation.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source SQL Connection. + */ +@Fluent +public final class SqlConnectionInformation implements JsonSerializable { + /* + * Data source. + */ + private String dataSource; + + /* + * Authentication type. + */ + private String authentication; + + /* + * User name to connect to source SQL. + */ + private String username; + + /* + * Password to connect to source SQL. + */ + private String password; + + /* + * Whether to encrypt connection or not. + */ + private Boolean encryptConnection; + + /* + * Whether to trust server certificate or not. + */ + private Boolean trustServerCertificate; + + /** + * Creates an instance of SqlConnectionInformation class. + */ + public SqlConnectionInformation() { + } + + /** + * Get the dataSource property: Data source. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source. + * + * @param dataSource the dataSource value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the authentication property: Authentication type. + * + * @return the authentication value. + */ + public String authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type. + * + * @param authentication the authentication value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withAuthentication(String authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the username property: User name to connect to source SQL. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name to connect to source SQL. + * + * @param username the username value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password to connect to source SQL. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password to connect to source SQL. + * + * @param password the password value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt connection or not. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt connection or not. + * + * @param encryptConnection the encryptConnection value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust server certificate or not. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust server certificate or not. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the SqlConnectionInformation object itself. + */ + public SqlConnectionInformation withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataSource", this.dataSource); + jsonWriter.writeStringField("authentication", this.authentication); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeBooleanField("encryptConnection", this.encryptConnection); + jsonWriter.writeBooleanField("trustServerCertificate", this.trustServerCertificate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlConnectionInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlConnectionInformation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlConnectionInformation. + */ + public static SqlConnectionInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlConnectionInformation deserializedSqlConnectionInformation = new SqlConnectionInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataSource".equals(fieldName)) { + deserializedSqlConnectionInformation.dataSource = reader.getString(); + } else if ("authentication".equals(fieldName)) { + deserializedSqlConnectionInformation.authentication = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedSqlConnectionInformation.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedSqlConnectionInformation.password = reader.getString(); + } else if ("encryptConnection".equals(fieldName)) { + deserializedSqlConnectionInformation.encryptConnection = reader.getNullable(JsonReader::getBoolean); + } else if ("trustServerCertificate".equals(fieldName)) { + deserializedSqlConnectionInformation.trustServerCertificate + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlConnectionInformation; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java new file mode 100644 index 000000000000..3883b8d28843 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbMigrationStatusDetails.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Detailed status of current Sql Db migration. + */ +@Immutable +public final class SqlDbMigrationStatusDetails implements JsonSerializable { + /* + * Current State of Migration. + */ + private String migrationState; + + /* + * Sql Data Copy errors, if any. + */ + private List sqlDataCopyErrors; + + /* + * Details on progress of ADF copy activities. + */ + private List listOfCopyProgressDetails; + + /** + * Creates an instance of SqlDbMigrationStatusDetails class. + */ + public SqlDbMigrationStatusDetails() { + } + + /** + * Get the migrationState property: Current State of Migration. + * + * @return the migrationState value. + */ + public String migrationState() { + return this.migrationState; + } + + /** + * Get the sqlDataCopyErrors property: Sql Data Copy errors, if any. + * + * @return the sqlDataCopyErrors value. + */ + public List sqlDataCopyErrors() { + return this.sqlDataCopyErrors; + } + + /** + * Get the listOfCopyProgressDetails property: Details on progress of ADF copy activities. + * + * @return the listOfCopyProgressDetails value. + */ + public List listOfCopyProgressDetails() { + return this.listOfCopyProgressDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listOfCopyProgressDetails() != null) { + listOfCopyProgressDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlDbMigrationStatusDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlDbMigrationStatusDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlDbMigrationStatusDetails. + */ + public static SqlDbMigrationStatusDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlDbMigrationStatusDetails deserializedSqlDbMigrationStatusDetails = new SqlDbMigrationStatusDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migrationState".equals(fieldName)) { + deserializedSqlDbMigrationStatusDetails.migrationState = reader.getString(); + } else if ("sqlDataCopyErrors".equals(fieldName)) { + List sqlDataCopyErrors = reader.readArray(reader1 -> reader1.getString()); + deserializedSqlDbMigrationStatusDetails.sqlDataCopyErrors = sqlDataCopyErrors; + } else if ("listOfCopyProgressDetails".equals(fieldName)) { + List listOfCopyProgressDetails + = reader.readArray(reader1 -> CopyProgressDetails.fromJson(reader1)); + deserializedSqlDbMigrationStatusDetails.listOfCopyProgressDetails = listOfCopyProgressDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlDbMigrationStatusDetails; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.java new file mode 100644 index 000000000000..126d7167f5e4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlDbOfflineConfiguration.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Offline configuration. + */ +@Immutable +public final class SqlDbOfflineConfiguration implements JsonSerializable { + /* + * Offline migration + */ + private Boolean offline; + + /** + * Creates an instance of SqlDbOfflineConfiguration class. + */ + public SqlDbOfflineConfiguration() { + } + + /** + * Get the offline property: Offline migration. + * + * @return the offline value. + */ + public Boolean offline() { + return this.offline; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlDbOfflineConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlDbOfflineConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlDbOfflineConfiguration. + */ + public static SqlDbOfflineConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlDbOfflineConfiguration deserializedSqlDbOfflineConfiguration = new SqlDbOfflineConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offline".equals(fieldName)) { + deserializedSqlDbOfflineConfiguration.offline = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlDbOfflineConfiguration; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.java new file mode 100644 index 000000000000..54c4347eab1d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlFileShare.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * File share. + */ +@Fluent +public final class SqlFileShare implements JsonSerializable { + /* + * Location as SMB share or local drive where backups are placed. + */ + private String path; + + /* + * Username to access the file share location for backups. + */ + private String username; + + /* + * Password for username to access file share location. + */ + private String password; + + /** + * Creates an instance of SqlFileShare class. + */ + public SqlFileShare() { + } + + /** + * Get the path property: Location as SMB share or local drive where backups are placed. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Location as SMB share or local drive where backups are placed. + * + * @param path the path value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the username property: Username to access the file share location for backups. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username to access the file share location for backups. + * + * @param username the username value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password for username to access file share location. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password for username to access file share location. + * + * @param password the password value to set. + * @return the SqlFileShare object itself. + */ + public SqlFileShare withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("username", this.username); + jsonWriter.writeStringField("password", this.password); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlFileShare from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlFileShare if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlFileShare. + */ + public static SqlFileShare fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlFileShare deserializedSqlFileShare = new SqlFileShare(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedSqlFileShare.path = reader.getString(); + } else if ("username".equals(fieldName)) { + deserializedSqlFileShare.username = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedSqlFileShare.password = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlFileShare; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java new file mode 100644 index 000000000000..3a76499130c5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of SQL Migration Service. + */ +@Immutable +public final class SqlMigrationListResult implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of SqlMigrationListResult class. + */ + public SqlMigrationListResult() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMigrationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMigrationListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlMigrationListResult. + */ + public static SqlMigrationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMigrationListResult deserializedSqlMigrationListResult = new SqlMigrationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SqlMigrationServiceInner.fromJson(reader1)); + deserializedSqlMigrationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlMigrationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMigrationListResult; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java new file mode 100644 index 000000000000..495f6fc74f76 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationService.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; +import com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner; +import java.util.Map; + +/** + * An immutable client-side representation of SqlMigrationService. + */ +public interface SqlMigrationService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The systemData property. + * + * @return the systemData value. + */ + SystemDataAutoGenerated systemData(); + + /** + * Gets the provisioningState property: Provisioning state to track the async operation status. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the integrationRuntimeState property: Current state of the Integration runtime. + * + * @return the integrationRuntimeState value. + */ + String integrationRuntimeState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.SqlMigrationServiceInner object. + * + * @return the inner object. + */ + SqlMigrationServiceInner innerModel(); + + /** + * The entirety of the SqlMigrationService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The SqlMigrationService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SqlMigrationService definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the SqlMigrationService definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the SqlMigrationService definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the SqlMigrationService definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlMigrationService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlMigrationService create(Context context); + } + + /** + * The stage of the SqlMigrationService definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + + /** + * Begins update for the SqlMigrationService resource. + * + * @return the stage of resource update. + */ + SqlMigrationService.Update update(); + + /** + * The template for SqlMigrationService update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlMigrationService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlMigrationService apply(Context context); + } + + /** + * The SqlMigrationService update stages. + */ + interface UpdateStages { + /** + * The stage of the SqlMigrationService update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Dictionary of <string>. + * + * @param tags Dictionary of <string>. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlMigrationService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlMigrationService refresh(Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + Response listAuthKeysWithResponse(Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + AuthenticationKeys listAuthKeys(); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + Response regenerateAuthKeysWithResponse(RegenAuthKeysInner parameters, Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + RegenAuthKeys regenerateAuthKeys(RegenAuthKeysInner parameters); + + /** + * Delete the integration runtime node. + * + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + Response deleteNodeWithResponse(DeleteNodeInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + DeleteNode deleteNode(DeleteNodeInner parameters); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + Response listMonitoringDataWithResponse(Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + IntegrationRuntimeMonitoringData listMonitoringData(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java new file mode 100644 index 000000000000..07eeaae1a30a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServiceUpdate.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * An update to a SQL Migration Service. + */ +@Fluent +public final class SqlMigrationServiceUpdate implements JsonSerializable { + /* + * Dictionary of + */ + private Map tags; + + /** + * Creates an instance of SqlMigrationServiceUpdate class. + */ + public SqlMigrationServiceUpdate() { + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the SqlMigrationServiceUpdate object itself. + */ + public SqlMigrationServiceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SqlMigrationServiceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SqlMigrationServiceUpdate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SqlMigrationServiceUpdate. + */ + public static SqlMigrationServiceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SqlMigrationServiceUpdate deserializedSqlMigrationServiceUpdate = new SqlMigrationServiceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlMigrationServiceUpdate.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSqlMigrationServiceUpdate; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java new file mode 100644 index 000000000000..71f7c55887ea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationServices.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** + * Resource collection API of SqlMigrationServices. + */ +public interface SqlMigrationServices { + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service. + */ + SqlMigrationService getByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Delete Database Migration Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sqlMigrationServiceName, Context context); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Retrieve all SQL migration services in the resource group. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key along with {@link Response}. + */ + Response listAuthKeysWithResponse(String resourceGroupName, String sqlMigrationServiceName, + Context context); + + /** + * Retrieve the List of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key. + */ + AuthenticationKeys listAuthKeys(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate along with {@link Response}. + */ + Response regenerateAuthKeysWithResponse(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters, Context context); + + /** + * Regenerate a new set of Authentication Keys for Self Hosted Integration Runtime. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an authentication key to regenerate. + */ + RegenAuthKeys regenerateAuthKeys(String resourceGroupName, String sqlMigrationServiceName, + RegenAuthKeysInner parameters); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted along with {@link Response}. + */ + Response deleteNodeWithResponse(String resourceGroupName, String sqlMigrationServiceName, + DeleteNodeInner parameters, Context context); + + /** + * Delete the integration runtime node. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param parameters Details of SqlMigrationService resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of node to be deleted. + */ + DeleteNode deleteNode(String resourceGroupName, String sqlMigrationServiceName, DeleteNodeInner parameters); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve the List of database migrations attached to the service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Database Migrations as paginated response with {@link PagedIterable}. + */ + PagedIterable listMigrations(String resourceGroupName, String sqlMigrationServiceName, + Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data along with {@link Response}. + */ + Response listMonitoringDataWithResponse(String resourceGroupName, + String sqlMigrationServiceName, Context context); + + /** + * Retrieve the registered Integration Runtime nodes and their monitoring data for a given Database Migration + * Service. + * + * @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from + * the Azure Resource Manager API or the portal. + * @param sqlMigrationServiceName Name of the SQL Migration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration Runtime Monitoring Data. + */ + IntegrationRuntimeMonitoringData listMonitoringData(String resourceGroupName, String sqlMigrationServiceName); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieve all SQL migration services in the subscriptions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL Migration Service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + SqlMigrationService getById(String id); + + /** + * Retrieve the Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Migration Service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Database Migration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlMigrationService resource. + * + * @param name resource name. + * @return the first stage of the new SqlMigrationService definition. + */ + SqlMigrationService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java index cc05fe4c7b5b..652df5d5be29 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java @@ -44,8 +44,8 @@ public class SqlServerSqlMISyncTaskInput implements JsonSerializable { + /* + * The SSIS store type of source, only SSIS catalog is supported now in DMS (classic) + */ + private SsisStoreType ssisStoreType; + + /* + * The overwrite option for the SSIS project migration + */ + private SsisMigrationOverwriteOption projectOverwriteOption; + + /* + * The overwrite option for the SSIS environment migration + */ + private SsisMigrationOverwriteOption environmentOverwriteOption; + + /** + * Creates an instance of SsisMigrationInfo class. + */ + public SsisMigrationInfo() { + } + + /** + * Get the ssisStoreType property: The SSIS store type of source, only SSIS catalog is supported now in DMS + * (classic). + * + * @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 + * (classic). + * + * @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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ssisStoreType", this.ssisStoreType == null ? null : this.ssisStoreType.toString()); + jsonWriter.writeStringField("projectOverwriteOption", + this.projectOverwriteOption == null ? null : this.projectOverwriteOption.toString()); + jsonWriter.writeStringField("environmentOverwriteOption", + this.environmentOverwriteOption == null ? null : this.environmentOverwriteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SsisMigrationInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SsisMigrationInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SsisMigrationInfo. + */ + public static SsisMigrationInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SsisMigrationInfo deserializedSsisMigrationInfo = new SsisMigrationInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ssisStoreType".equals(fieldName)) { + deserializedSsisMigrationInfo.ssisStoreType = SsisStoreType.fromString(reader.getString()); + } else if ("projectOverwriteOption".equals(fieldName)) { + deserializedSsisMigrationInfo.projectOverwriteOption + = SsisMigrationOverwriteOption.fromString(reader.getString()); + } else if ("environmentOverwriteOption".equals(fieldName)) { + deserializedSsisMigrationInfo.environmentOverwriteOption + = SsisMigrationOverwriteOption.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSsisMigrationInfo; + }); + } +} 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 000000000000..893b0ae925fb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The overwrite option for SSIS object migration, only ignore and overwrite are supported in DMS (classic) now and + * future may add Reuse option for container object. + */ +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 a new instance of SsisMigrationOverwriteOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SsisMigrationOverwriteOption() { + } + + /** + * Creates or finds a SsisMigrationOverwriteOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationOverwriteOption. + */ + public static SsisMigrationOverwriteOption fromString(String name) { + return fromString(name, SsisMigrationOverwriteOption.class); + } + + /** + * Gets known SsisMigrationOverwriteOption values. + * + * @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 000000000000..137029151848 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.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 java.util.Collection; + +/** + * Current stage of SSIS migration. + */ +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 a new instance of SsisMigrationStage value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SsisMigrationStage() { + } + + /** + * Creates or finds a SsisMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationStage. + */ + public static SsisMigrationStage fromString(String name) { + return fromString(name, SsisMigrationStage.class); + } + + /** + * Gets known SsisMigrationStage values. + * + * @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 000000000000..252e0bc257db --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.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 java.util.Collection; + +/** + * An enumeration of supported source SSIS store type in DMS (classic). + */ +public final class SsisStoreType extends ExpandableStringEnum { + /** + * Static value SsisCatalog for SsisStoreType. + */ + public static final SsisStoreType SSIS_CATALOG = fromString("SsisCatalog"); + + /** + * Creates a new instance of SsisStoreType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SsisStoreType() { + } + + /** + * Creates or finds a SsisStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisStoreType. + */ + public static SsisStoreType fromString(String name) { + return fromString(name, SsisStoreType.class); + } + + /** + * Gets known SsisStoreType values. + * + * @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 b932b710ddf0..e7b622dbbd33 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 @@ -67,6 +67,41 @@ public final class 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 a new instance of SyncDatabaseMigrationReportingState value. * diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SystemDataAutoGenerated.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SystemDataAutoGenerated.java new file mode 100644 index 000000000000..59d322d24f13 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SystemDataAutoGenerated.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The SystemDataAutoGenerated model. + */ +@Fluent +public final class SystemDataAutoGenerated implements JsonSerializable { + /* + * The createdBy property. + */ + private String createdBy; + + /* + * The type of identity that created the resource. + */ + private CreatedByType createdByType; + + /* + * The createdAt property. + */ + private OffsetDateTime createdAt; + + /* + * The lastModifiedBy property. + */ + private String lastModifiedBy; + + /* + * The type of identity that created the resource. + */ + private CreatedByType lastModifiedByType; + + /* + * The lastModifiedAt property. + */ + private OffsetDateTime lastModifiedAt; + + /** + * Creates an instance of SystemDataAutoGenerated class. + */ + public SystemDataAutoGenerated() { + } + + /** + * Get the createdBy property: The createdBy property. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: The createdBy property. + * + * @param createdBy the createdBy value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: The type of identity that created the resource. + * + * @return the createdByType value. + */ + public CreatedByType createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of identity that created the resource. + * + * @param createdByType the createdByType value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: The createdAt property. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The createdAt property. + * + * @param createdAt the createdAt value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: The lastModifiedBy property. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: The lastModifiedBy property. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: The type of identity that created the resource. + * + * @return the lastModifiedByType value. + */ + public CreatedByType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: The type of identity that created the resource. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withLastModifiedByType(CreatedByType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: The lastModifiedAt property. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: The lastModifiedAt property. + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemDataAutoGenerated object itself. + */ + public SystemDataAutoGenerated withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdByType", this.createdByType == null ? null : this.createdByType.toString()); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedByType", + this.lastModifiedByType == null ? null : this.lastModifiedByType.toString()); + jsonWriter.writeStringField("lastModifiedAt", + this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemDataAutoGenerated from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemDataAutoGenerated if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SystemDataAutoGenerated. + */ + public static SystemDataAutoGenerated fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemDataAutoGenerated deserializedSystemDataAutoGenerated = new SystemDataAutoGenerated(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdBy".equals(fieldName)) { + deserializedSystemDataAutoGenerated.createdBy = reader.getString(); + } else if ("createdByType".equals(fieldName)) { + deserializedSystemDataAutoGenerated.createdByType = CreatedByType.fromString(reader.getString()); + } else if ("createdAt".equals(fieldName)) { + deserializedSystemDataAutoGenerated.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedSystemDataAutoGenerated.lastModifiedBy = reader.getString(); + } else if ("lastModifiedByType".equals(fieldName)) { + deserializedSystemDataAutoGenerated.lastModifiedByType + = CreatedByType.fromString(reader.getString()); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedSystemDataAutoGenerated.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSystemDataAutoGenerated; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java new file mode 100644 index 000000000000..369a1bf93b6d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TargetLocation.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Target Location details for optional copy of backups. + */ +@Fluent +public final class TargetLocation implements JsonSerializable { + /* + * Resource Id of the storage account copying backups. + */ + private String storageAccountResourceId; + + /* + * Storage Account Key. + */ + private String accountKey; + + /** + * Creates an instance of TargetLocation class. + */ + public TargetLocation() { + } + + /** + * Get the storageAccountResourceId property: Resource Id of the storage account copying backups. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Resource Id of the storage account copying backups. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the TargetLocation object itself. + */ + public TargetLocation withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the accountKey property: Storage Account Key. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage Account Key. + * + * @param accountKey the accountKey value to set. + * @return the TargetLocation object itself. + */ + public TargetLocation withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageAccountResourceId", this.storageAccountResourceId); + jsonWriter.writeStringField("accountKey", this.accountKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetLocation. + */ + public static TargetLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetLocation deserializedTargetLocation = new TargetLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccountResourceId".equals(fieldName)) { + deserializedTargetLocation.storageAccountResourceId = reader.getString(); + } else if ("accountKey".equals(fieldName)) { + deserializedTargetLocation.accountKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetLocation; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java new file mode 100644 index 000000000000..131f0de3e356 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskType.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Task type. + */ +public final class TaskType extends ExpandableStringEnum { + /** + * Static value Connect.MongoDb for TaskType. + */ + public static final TaskType CONNECT_MONGO_DB = fromString("Connect.MongoDb"); + + /** + * Static value ConnectToSource.SqlServer for TaskType. + */ + public static final TaskType CONNECT_TO_SOURCE_SQL_SERVER = fromString("ConnectToSource.SqlServer"); + + /** + * Static value ConnectToSource.SqlServer.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_SOURCE_SQL_SERVER_SYNC = fromString("ConnectToSource.SqlServer.Sync"); + + /** + * Static value ConnectToSource.PostgreSql.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC = fromString("ConnectToSource.PostgreSql.Sync"); + + /** + * Static value ConnectToSource.MySql for TaskType. + */ + public static final TaskType CONNECT_TO_SOURCE_MY_SQL = fromString("ConnectToSource.MySql"); + + /** + * Static value ConnectToSource.Oracle.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_SOURCE_ORACLE_SYNC = fromString("ConnectToSource.Oracle.Sync"); + + /** + * Static value ConnectToTarget.SqlDb for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_SQL_DB = fromString("ConnectToTarget.SqlDb"); + + /** + * Static value ConnectToTarget.SqlDb.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_SQL_DB_SYNC = fromString("ConnectToTarget.SqlDb.Sync"); + + /** + * Static value ConnectToTarget.AzureDbForPostgreSql.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC + = fromString("ConnectToTarget.AzureDbForPostgreSql.Sync"); + + /** + * Static value ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC + = fromString("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync"); + + /** + * Static value ConnectToTarget.AzureSqlDbMI for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_AZURE_SQL_DB_MI = fromString("ConnectToTarget.AzureSqlDbMI"); + + /** + * Static value ConnectToTarget.AzureSqlDbMI.Sync.LRS for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS + = fromString("ConnectToTarget.AzureSqlDbMI.Sync.LRS"); + + /** + * Static value ConnectToTarget.AzureDbForMySql for TaskType. + */ + public static final TaskType CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL = fromString("ConnectToTarget.AzureDbForMySql"); + + /** + * Static value GetUserTables.Sql for TaskType. + */ + public static final TaskType GET_USER_TABLES_SQL = fromString("GetUserTables.Sql"); + + /** + * Static value GetUserTables.AzureSqlDb.Sync for TaskType. + */ + public static final TaskType GET_USER_TABLES_AZURE_SQL_DB_SYNC = fromString("GetUserTables.AzureSqlDb.Sync"); + + /** + * Static value GetUserTablesOracle for TaskType. + */ + public static final TaskType GET_USER_TABLES_ORACLE = fromString("GetUserTablesOracle"); + + /** + * Static value GetUserTablesPostgreSql for TaskType. + */ + public static final TaskType GET_USER_TABLES_POSTGRE_SQL = fromString("GetUserTablesPostgreSql"); + + /** + * Static value GetUserTablesMySql for TaskType. + */ + public static final TaskType GET_USER_TABLES_MY_SQL = fromString("GetUserTablesMySql"); + + /** + * Static value Migrate.MongoDb for TaskType. + */ + public static final TaskType MIGRATE_MONGO_DB = fromString("Migrate.MongoDb"); + + /** + * Static value Migrate.SqlServer.AzureSqlDbMI for TaskType. + */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI = fromString("Migrate.SqlServer.AzureSqlDbMI"); + + /** + * Static value Migrate.SqlServer.AzureSqlDbMI.Sync.LRS for TaskType. + */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS + = fromString("Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"); + + /** + * Static value Migrate.SqlServer.SqlDb for TaskType. + */ + public static final TaskType MIGRATE_SQL_SERVER_SQL_DB = fromString("Migrate.SqlServer.SqlDb"); + + /** + * Static value Migrate.SqlServer.AzureSqlDb.Sync for TaskType. + */ + public static final TaskType MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC = fromString("Migrate.SqlServer.AzureSqlDb.Sync"); + + /** + * Static value Migrate.MySql.AzureDbForMySql.Sync for TaskType. + */ + public static final TaskType MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC + = fromString("Migrate.MySql.AzureDbForMySql.Sync"); + + /** + * Static value Migrate.MySql.AzureDbForMySql for TaskType. + */ + public static final TaskType MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL = fromString("Migrate.MySql.AzureDbForMySql"); + + /** + * Static value Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2 for TaskType. + */ + public static final TaskType MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2 + = fromString("Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2"); + + /** + * Static value Migrate.Oracle.AzureDbForPostgreSql.Sync for TaskType. + */ + public static final TaskType MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC + = fromString("Migrate.Oracle.AzureDbForPostgreSql.Sync"); + + /** + * Static value ValidateMigrationInput.SqlServer.SqlDb.Sync for TaskType. + */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC + = fromString("ValidateMigrationInput.SqlServer.SqlDb.Sync"); + + /** + * Static value ValidateMigrationInput.SqlServer.AzureSqlDbMI for TaskType. + */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI + = fromString("ValidateMigrationInput.SqlServer.AzureSqlDbMI"); + + /** + * Static value ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS for TaskType. + */ + public static final TaskType VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS + = fromString("ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"); + + /** + * Static value Validate.MongoDb for TaskType. + */ + public static final TaskType VALIDATE_MONGO_DB = fromString("Validate.MongoDb"); + + /** + * Static value Validate.Oracle.AzureDbPostgreSql.Sync for TaskType. + */ + public static final TaskType VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC + = fromString("Validate.Oracle.AzureDbPostgreSql.Sync"); + + /** + * Static value GetTDECertificates.Sql for TaskType. + */ + public static final TaskType GET_TDECERTIFICATES_SQL = fromString("GetTDECertificates.Sql"); + + /** + * Static value Migrate.Ssis for TaskType. + */ + public static final TaskType MIGRATE_SSIS = fromString("Migrate.Ssis"); + + /** + * Static value Service.Check.OCI for TaskType. + */ + public static final TaskType SERVICE_CHECK_OCI = fromString("Service.Check.OCI"); + + /** + * Static value Service.Upload.OCI for TaskType. + */ + public static final TaskType SERVICE_UPLOAD_OCI = fromString("Service.Upload.OCI"); + + /** + * Static value Service.Install.OCI for TaskType. + */ + public static final TaskType SERVICE_INSTALL_OCI = fromString("Service.Install.OCI"); + + /** + * Static value MigrateSchemaSqlServerSqlDb for TaskType. + */ + public static final TaskType MIGRATE_SCHEMA_SQL_SERVER_SQL_DB = fromString("MigrateSchemaSqlServerSqlDb"); + + /** + * Creates a new instance of TaskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TaskType() { + } + + /** + * Creates or finds a TaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskType. + */ + public static TaskType fromString(String name) { + return fromString(name, TaskType.class); + } + + /** + * Gets known TaskType values. + * + * @return known TaskType values. + */ + public static Collection values() { + return values(TaskType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java index 080d5d3e09e5..58c3c8fbd1b5 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. @@ -15,9 +16,9 @@ public interface Tasks { /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -32,9 +33,9 @@ public interface Tasks { /** * Get tasks in a service * - * The services resource is the top-level resource that represents the Database Migration Service. This method - * returns a list of 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. + * The services resource is the top-level resource that represents the Azure Database Migration Service (classic). + * This method returns a list of 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. @@ -52,8 +53,8 @@ PagedIterable list(String groupName, String serviceName, String pro /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -72,8 +73,8 @@ Response getWithResponse(String groupName, String serviceName, Stri /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -89,8 +90,8 @@ Response getWithResponse(String groupName, String serviceName, Stri /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -109,8 +110,8 @@ Response deleteWithResponse(String groupName, String serviceName, String p /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -125,8 +126,8 @@ Response deleteWithResponse(String groupName, String serviceName, String p /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -144,8 +145,8 @@ Response cancelWithResponse(String groupName, String serviceName, S /** * Cancel a task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method - * cancels a task if it's currently queued or running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This + * method cancels a task if it's currently queued or running. * * @param groupName Name of the resource group. * @param serviceName Name of the service. @@ -158,11 +159,50 @@ Response cancelWithResponse(String groupName, String serviceName, S */ ProjectTask cancel(String groupName, String serviceName, String projectName, String taskName); + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties along with {@link Response}. + */ + Response commandWithResponse(String groupName, String serviceName, String projectName, + String taskName, CommandPropertiesInner parameters, Context context); + + /** + * Execute a command on a task + * + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) 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 (classic) command properties. + */ + CommandProperties command(String groupName, String serviceName, String projectName, String taskName, + CommandPropertiesInner parameters); + /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -175,8 +215,8 @@ Response cancelWithResponse(String groupName, String serviceName, S /** * Get task information * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method - * retrieves information about a task. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * GET method retrieves information about a task. * * @param id the resource ID. * @param expand Expand the response. @@ -191,8 +231,8 @@ Response cancelWithResponse(String groupName, String serviceName, S /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -204,8 +244,8 @@ Response cancelWithResponse(String groupName, String serviceName, S /** * Delete task * - * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE - * method deletes a task, canceling it first if it's running. + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The + * DELETE method deletes a task, canceling it first if it's running. * * @param id the resource ID. * @param deleteRunningTasks Delete the resource even if it contains running tasks. 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 000000000000..c291d2396adb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input for the service task to upload an OCI driver. + */ +@Fluent +public final class UploadOciDriverTaskInput implements JsonSerializable { + /* + * File share information for the OCI driver archive. + */ + private FileShare driverShare; + + /** + * Creates an instance of UploadOciDriverTaskInput class. + */ + public UploadOciDriverTaskInput() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("driverShare", this.driverShare); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UploadOciDriverTaskInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UploadOciDriverTaskInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UploadOciDriverTaskInput. + */ + public static UploadOciDriverTaskInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UploadOciDriverTaskInput deserializedUploadOciDriverTaskInput = new UploadOciDriverTaskInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driverShare".equals(fieldName)) { + deserializedUploadOciDriverTaskInput.driverShare = FileShare.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUploadOciDriverTaskInput; + }); + } +} 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 000000000000..d0c6bb1b2902 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Output for the service task to upload an OCI driver. + */ +@Immutable +public final class UploadOciDriverTaskOutput implements JsonSerializable { + /* + * The name of the driver package that was validated and uploaded. + */ + private String driverPackageName; + + /* + * Validation errors + */ + private List validationErrors; + + /** + * Creates an instance of UploadOciDriverTaskOutput class. + */ + public UploadOciDriverTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UploadOciDriverTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UploadOciDriverTaskOutput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UploadOciDriverTaskOutput. + */ + public static UploadOciDriverTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UploadOciDriverTaskOutput deserializedUploadOciDriverTaskOutput = new UploadOciDriverTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driverPackageName".equals(fieldName)) { + deserializedUploadOciDriverTaskOutput.driverPackageName = reader.getString(); + } else if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedUploadOciDriverTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedUploadOciDriverTaskOutput; + }); + } +} 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 000000000000..0c791f99d866 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that uploads an OCI driver. + */ +@Fluent +public final class UploadOciDriverTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.SERVICE_UPLOAD_OCI; + + /* + * Input for the service task to upload an OCI driver. + */ + private UploadOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + private List output; + + /** + * Creates an instance of UploadOciDriverTaskProperties class. + */ + public UploadOciDriverTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UploadOciDriverTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UploadOciDriverTaskProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UploadOciDriverTaskProperties. + */ + public static UploadOciDriverTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UploadOciDriverTaskProperties deserializedUploadOciDriverTaskProperties + = new UploadOciDriverTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedUploadOciDriverTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedUploadOciDriverTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedUploadOciDriverTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedUploadOciDriverTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedUploadOciDriverTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedUploadOciDriverTaskProperties.input = UploadOciDriverTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> UploadOciDriverTaskOutput.fromJson(reader1)); + deserializedUploadOciDriverTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedUploadOciDriverTaskProperties; + }); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java index 5140369c8d42..6c71f583f070 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java @@ -14,7 +14,8 @@ public interface Usages { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +28,8 @@ public interface Usages { /** * Get resource quotas and usage information * - * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * This method returns region-specific quotas and resource usage information for the Azure Database Migration + * Service (classic). * * @param location The Azure region of the operation. * @param context The context to associate with this operation. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UserAssignedIdentity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..f121a8030502 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} 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 d194a221cabf..c21fb861affa 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for task that validates migration input for SQL to Azure SQL DB sync migrations. @@ -20,7 +22,7 @@ public final class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extend /* * Task type. */ - private String taskType = "ValidateMigrationInput.SqlServer.SqlDb.Sync"; + private TaskType taskType = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC; /* * Task input @@ -44,7 +46,7 @@ public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -78,6 +80,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -102,7 +113,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -131,10 +143,15 @@ public static ValidateMigrationInputSqlServerSqlDbSyncTaskProperties fromJson(Js deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties.taskType = reader.getString(); + deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedValidateMigrationInputSqlServerSqlDbSyncTaskProperties.input = ValidateSyncMigrationInputSqlServerTaskInput.fromJson(reader); 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 71efbb55c10f..1d8a14b9b8e1 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; 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. @@ -20,7 +22,7 @@ public final class ValidateMigrationInputSqlServerSqlMISyncTaskProperties extend /* * Task type. */ - private String taskType = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"; + private TaskType taskType = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS; /* * Task input @@ -44,7 +46,7 @@ public ValidateMigrationInputSqlServerSqlMISyncTaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -78,6 +80,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -102,7 +113,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -131,10 +143,15 @@ public static ValidateMigrationInputSqlServerSqlMISyncTaskProperties fromJson(Js deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties.taskType = reader.getString(); + deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedValidateMigrationInputSqlServerSqlMISyncTaskProperties.input = ValidateMigrationInputSqlServerSqlMISyncTaskInput.fromJson(reader); 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 6f586e5d7510..c1b6fc200423 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 @@ -9,8 +9,10 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; import java.io.IOException; import java.util.List; +import java.util.Map; /** * Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance. @@ -20,7 +22,7 @@ public final class ValidateMigrationInputSqlServerSqlMITaskProperties extends Pr /* * Task type. */ - private String taskType = "ValidateMigrationInput.SqlServer.AzureSqlDbMI"; + private TaskType taskType = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI; /* * Task input @@ -44,7 +46,7 @@ public ValidateMigrationInputSqlServerSqlMITaskProperties() { * @return the taskType value. */ @Override - public String taskType() { + public TaskType taskType() { return this.taskType; } @@ -78,6 +80,15 @@ public List output() { return this.output; } + /** + * {@inheritDoc} + */ + @Override + public ValidateMigrationInputSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + /** * Validates the instance. * @@ -102,7 +113,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskType", this.taskType); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); jsonWriter.writeJsonField("input", this.input); return jsonWriter.writeEndObject(); } @@ -131,10 +143,15 @@ public static ValidateMigrationInputSqlServerSqlMITaskProperties fromJson(JsonRe deserializedValidateMigrationInputSqlServerSqlMITaskProperties .withState(TaskState.fromString(reader.getString())); } else if ("commands".equals(fieldName)) { - List commands = reader.readArray(reader1 -> CommandProperties.fromJson(reader1)); + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); deserializedValidateMigrationInputSqlServerSqlMITaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedValidateMigrationInputSqlServerSqlMITaskProperties.withClientData(clientData); } else if ("taskType".equals(fieldName)) { - deserializedValidateMigrationInputSqlServerSqlMITaskProperties.taskType = reader.getString(); + deserializedValidateMigrationInputSqlServerSqlMITaskProperties.taskType + = TaskType.fromString(reader.getString()); } else if ("input".equals(fieldName)) { deserializedValidateMigrationInputSqlServerSqlMITaskProperties.input = ValidateMigrationInputSqlServerSqlMITaskInput.fromJson(reader); 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 000000000000..30110126a5a1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates a migration between MongoDB data sources. + */ +@Fluent +public final class ValidateMongoDbTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.VALIDATE_MONGO_DB; + + /* + * Describes how a MongoDB data migration should be performed + */ + private MongoDbMigrationSettings input; + + /* + * An array containing a single MongoDbMigrationProgress object + */ + private List output; + + /** + * Creates an instance of ValidateMongoDbTaskProperties class. + */ + public ValidateMongoDbTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateMongoDbTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateMongoDbTaskProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateMongoDbTaskProperties. + */ + public static ValidateMongoDbTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateMongoDbTaskProperties deserializedValidateMongoDbTaskProperties + = new ValidateMongoDbTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedValidateMongoDbTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedValidateMongoDbTaskProperties.withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedValidateMongoDbTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedValidateMongoDbTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedValidateMongoDbTaskProperties.taskType = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedValidateMongoDbTaskProperties.input = MongoDbMigrationSettings.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> MongoDbMigrationProgress.fromJson(reader1)); + deserializedValidateMongoDbTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedValidateMongoDbTaskProperties; + }); + } +} 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 000000000000..baec6ba561db --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.io.IOException; +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. + */ +@Fluent +public final class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + /* + * Task type. + */ + private TaskType taskType = TaskType.VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC; + + /* + * Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations + */ + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * An array containing a single validation error response object + */ + private List output; + + /** + * Creates an instance of ValidateOracleAzureDbForPostgreSqlSyncTaskProperties class. + */ + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties() { + } + + /** + * Get the taskType property: Task type. + * + * @return the taskType value. + */ + @Override + public TaskType taskType() { + return this.taskType; + } + + /** + * 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() { + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("clientData", clientData(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("taskType", this.taskType == null ? null : this.taskType.toString()); + jsonWriter.writeJsonField("input", this.input); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateOracleAzureDbForPostgreSqlSyncTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateOracleAzureDbForPostgreSqlSyncTaskProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateOracleAzureDbForPostgreSqlSyncTaskProperties. + */ + public static ValidateOracleAzureDbForPostgreSqlSyncTaskProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ValidateOracleAzureDbForPostgreSqlSyncTaskProperties deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties + = new ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.withErrors(errors); + } else if ("state".equals(fieldName)) { + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties + .withState(TaskState.fromString(reader.getString())); + } else if ("commands".equals(fieldName)) { + List commands + = reader.readArray(reader1 -> CommandPropertiesInner.fromJson(reader1)); + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.withCommands(commands); + } else if ("clientData".equals(fieldName)) { + Map clientData = reader.readMap(reader1 -> reader1.getString()); + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.withClientData(clientData); + } else if ("taskType".equals(fieldName)) { + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.taskType + = TaskType.fromString(reader.getString()); + } else if ("input".equals(fieldName)) { + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.input + = MigrateOracleAzureDbPostgreSqlSyncTaskInput.fromJson(reader); + } else if ("output".equals(fieldName)) { + List output + = reader.readArray(reader1 -> ValidateOracleAzureDbPostgreSqlSyncTaskOutput.fromJson(reader1)); + deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties.output = output; + } else { + reader.skipChildren(); + } + } + + return deserializedValidateOracleAzureDbForPostgreSqlSyncTaskProperties; + }); + } +} 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 000000000000..a3c8aaac639e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * Errors associated with a selected database object + */ + private List validationErrors; + + /** + * Creates an instance of ValidateOracleAzureDbPostgreSqlSyncTaskOutput class. + */ + public ValidateOracleAzureDbPostgreSqlSyncTaskOutput() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateOracleAzureDbPostgreSqlSyncTaskOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateOracleAzureDbPostgreSqlSyncTaskOutput if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateOracleAzureDbPostgreSqlSyncTaskOutput. + */ + public static ValidateOracleAzureDbPostgreSqlSyncTaskOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateOracleAzureDbPostgreSqlSyncTaskOutput deserializedValidateOracleAzureDbPostgreSqlSyncTaskOutput + = new ValidateOracleAzureDbPostgreSqlSyncTaskOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validationErrors".equals(fieldName)) { + List validationErrors + = reader.readArray(reader1 -> ReportableException.fromJson(reader1)); + deserializedValidateOracleAzureDbPostgreSqlSyncTaskOutput.validationErrors = validationErrors; + } else { + reader.skipChildren(); + } + } + + return deserializedValidateOracleAzureDbPostgreSqlSyncTaskOutput; + }); + } +} 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 69a973b1b0fb..e51beaf839eb 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,7 +4,7 @@ package com.azure.resourcemanager.datamigration.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Description about the errors happen while performing migration validation. */ -@Immutable +@Fluent public final class ValidationError implements JsonSerializable { /* * Error Text @@ -41,6 +41,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. * @@ -50,6 +61,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. * @@ -64,6 +86,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); return jsonWriter.writeEndObject(); } 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 41ecbcfb99b3..2ab669b9d2e4 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 @@ -42,14 +42,14 @@ public final class ValidationStatus extends ExpandableStringEnum { /* * Type of the Wait @@ -46,6 +46,17 @@ public String waitType() { return this.waitType; } + /** + * Set the waitType property: Type of the Wait. + * + * @param waitType the waitType value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitType(String waitType) { + this.waitType = waitType; + return this; + } + /** * Get the waitTimeMs property: Total wait time in millisecond(s). * @@ -55,6 +66,17 @@ public Float waitTimeMs() { return this.waitTimeMs; } + /** + * Set the waitTimeMs property: Total wait time in millisecond(s). + * + * @param waitTimeMs the waitTimeMs value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitTimeMs(Float waitTimeMs) { + this.waitTimeMs = waitTimeMs; + return this; + } + /** * Get the waitCount property: Total no. of waits. * @@ -64,6 +86,17 @@ public Long waitCount() { return this.waitCount; } + /** + * Set the waitCount property: Total no. of waits. + * + * @param waitCount the waitCount value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitCount(Long waitCount) { + this.waitCount = waitCount; + return this; + } + /** * Validates the instance. * @@ -78,6 +111,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("waitType", this.waitType); + jsonWriter.writeNumberField("waitTimeMs", this.waitTimeMs); + jsonWriter.writeNumberField("waitCount", this.waitCount); return jsonWriter.writeEndObject(); } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/proxy-config.json b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/proxy-config.json index c96f5e91f890..ed70bc7f1f85 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/proxy-config.json +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.datamigration.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.datamigration.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.datamigration.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.datamigration.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.datamigration.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.datamigration.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsMongoToCosmosDbRUMongoesClientImpl$DatabaseMigrationsMongoToCosmosDbRUMongoesService"],["com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsMongoToCosmosDbvCoreMongoesClientImpl$DatabaseMigrationsMongoToCosmosDbvCoreMongoesService"],["com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlDbsClientImpl$DatabaseMigrationsSqlDbsService"],["com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlMisClientImpl$DatabaseMigrationsSqlMisService"],["com.azure.resourcemanager.datamigration.implementation.DatabaseMigrationsSqlVmsClientImpl$DatabaseMigrationsSqlVmsService"],["com.azure.resourcemanager.datamigration.implementation.FilesClientImpl$FilesService"],["com.azure.resourcemanager.datamigration.implementation.MigrationServicesClientImpl$MigrationServicesService"],["com.azure.resourcemanager.datamigration.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.datamigration.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.datamigration.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.datamigration.implementation.ServiceTasksClientImpl$ServiceTasksService"],["com.azure.resourcemanager.datamigration.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.datamigration.implementation.SqlMigrationServicesClientImpl$SqlMigrationServicesService"],["com.azure.resourcemanager.datamigration.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.datamigration.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/reflect-config.json b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/reflect-config.json index 0637a088a01e..8d0e7506e0f7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/reflect-config.json +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-datamigration/reflect-config.json @@ -1 +1 @@ -[] \ No newline at end of file +[{"name":"com.azure.resourcemanager.datamigration.models.SystemDataAutoGenerated","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/azure-resourcemanager-datamigration.properties b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/azure-resourcemanager-datamigration.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/resources/azure-resourcemanager-datamigration.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples.java new file mode 100644 index 000000000000..c9ff3a81907d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples.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.generated; + +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.MongoConnectionInformation; +import com.azure.resourcemanager.datamigration.models.MongoMigrationCollection; +import java.util.Arrays; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Create. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoCreateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(RU) Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoRUDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .define("migrationRequest") + .withExistingDatabaseAccount("testrg", "targetCosmosDbClusterName") + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection( + new MongoConnectionInformation().withHost("xyz.mongocluster.cosmos.azure.com") + .withPort(10255) + .withUsername("def") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2") + .withTargetDatabase("sourceDb2") + .withTargetCollection("sourceCol2")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(RU) Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoRUDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .define("migrationRequest") + .withExistingDatabaseAccount("testrg", "targetCosmosDbClusterName") + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection(new MongoConnectionInformation().withConnectionString("placeholder")) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2").withSourceCollection("sourceCol2")))) + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples.java new file mode 100644 index 000000000000..da9604986cc0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Delete. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Mongo to CosmosDb Mongo(RU) Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteMongoToCosmosDbMongoRUDatabaseMigrationResource( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .delete("testrg", "targetCosmosDbClusterName", "migrationRequest", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples.java new file mode 100644 index 000000000000..467a62c33a84 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo GetForScope. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoGetForScopeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples.java new file mode 100644 index 000000000000..e0d30b69e0c2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples.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.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbRUMongo Get. + */ +public final class DatabaseMigrationsMongoToCosmosDbRUMongoGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(RU) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoRUDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbRUMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples.java new file mode 100644 index 000000000000..7c97e49b4f37 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples.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.generated; + +import com.azure.resourcemanager.datamigration.fluent.models.DatabaseMigrationCosmosDbMongoInner; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo; +import com.azure.resourcemanager.datamigration.models.MongoConnectionInformation; +import com.azure.resourcemanager.datamigration.models.MongoMigrationCollection; +import java.util.Arrays; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Create. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoCreateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(vCore) Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoVCoreDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .create("testrg", "targetCosmosDbClusterName", "migrationRequest", new DatabaseMigrationCosmosDbMongoInner() + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection(new MongoConnectionInformation().withConnectionString("placeholder")) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create Mongo to CosmosDb Mongo(vCore) Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createMongoToCosmosDbMongoVCoreDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .create("testrg", "targetCosmosDbClusterName", "migrationRequest", new DatabaseMigrationCosmosDbMongoInner() + .withProperties(new DatabaseMigrationPropertiesCosmosDbMongo().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DocumentDB/mongoClusters/targetCosmosDbClusterName") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/MigrationServices/testMigrationService") + .withSourceMongoConnection(new MongoConnectionInformation().withHost("abc.mongodb.com") + .withPort(88) + .withUsername("abc") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withTargetMongoConnection( + new MongoConnectionInformation().withHost("xyz.mongocluster.cosmos.azure.com") + .withPort(10255) + .withUsername("def") + .withPassword("fakeTokenPlaceholder") + .withUseSsl(true)) + .withCollectionList(Arrays.asList( + new MongoMigrationCollection().withSourceDatabase("sourceDb1") + .withSourceCollection("sourceCol1") + .withTargetDatabase("targetDb1") + .withTargetCollection("targetCol1"), + new MongoMigrationCollection().withSourceDatabase("sourceDb2") + .withSourceCollection("sourceCol2") + .withTargetDatabase("sourceDb2") + .withTargetCollection("sourceCol2")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples.java new file mode 100644 index 000000000000..e5b468742744 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Delete. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Mongo to CosmosDb Mongo(vCore) Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteMongoToCosmosDbMongoVCoreDatabaseMigrationResource( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .delete("testrg", "targetCosmosDbClusterName", "migrationRequest", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples.java new file mode 100644 index 000000000000..8c96b6637cc5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo GetForScope. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoGetForScopeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoListByScopeDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getForScope("testrg", "targetCosmosDbClusterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples.java new file mode 100644 index 000000000000..8fabaa191a23 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples.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.generated; + +/** + * Samples for DatabaseMigrationsMongoToCosmosDbvCoreMongo Get. + */ +public final class DatabaseMigrationsMongoToCosmosDbvCoreMongoGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CosmosDbMongoGetDatabaseMigration.json + */ + /** + * Sample code: Get Mongo to CosmosDb Mongo(vCore) database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMongoToCosmosDbMongoVCoreDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsMongoToCosmosDbvCoreMongoes() + .getWithResponse("testrg", "targetCosmosDbClusterName", "migrationRequest", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCancelSamples.java new file mode 100644 index 000000000000..851502816a94 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCancelSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlDb Cancel. + */ +public final class DatabaseMigrationsSqlDbCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .cancel("testrg", "sqldbinstance", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("9a90bb84-e70f-46f7-b0ae-1aef5b3b9f07")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCreateOrUpdateSamples.java new file mode 100644 index 000000000000..5983457ce5b6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbCreateOrUpdateSamples.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlDb; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import java.util.Arrays; + +/** + * Samples for DatabaseMigrationsSqlDb CreateOrUpdate. + */ +public final class DatabaseMigrationsSqlDbCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties(new DatabaseMigrationPropertiesSqlDb().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withTargetSqlConnection(new SqlConnectionInformation().withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withTableList(Arrays.asList("[Schema1].[TableName1]", "[Schema2].[TableName2]"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .define("db1") + .withExistingServer("testrg", "sqldbinstance") + .withProperties(new DatabaseMigrationPropertiesSqlDb().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/servers/sqldbinstance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withTargetSqlConnection(new SqlConnectionInformation().withDataSource("sqldbinstance") + .withAuthentication("SqlAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true))) + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbDeleteSamples.java new file mode 100644 index 000000000000..bf4f4b01a53b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for DatabaseMigrationsSqlDb Delete. + */ +public final class DatabaseMigrationsSqlDbDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbDeleteDatabaseMigration.json + */ + /** + * Sample code: Delete Database Migration resource. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + deleteDatabaseMigrationResource(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .delete("testrg", "sqldbinstance", "db1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbGetSamples.java new file mode 100644 index 000000000000..6dec96a17085 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlDbGetSamples.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.generated; + +/** + * Samples for DatabaseMigrationsSqlDb Get. + */ +public final class DatabaseMigrationsSqlDbGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql DB database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlDBDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .getWithResponse("testrg", "sqldbinstance", "db1", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlDbGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql DB database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlDBDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlDbs() + .getWithResponse("testrg", "sqldbinstance", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCancelSamples.java new file mode 100644 index 000000000000..85bf05231633 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCancelSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlMi Cancel. + */ +public final class DatabaseMigrationsSqlMiCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .cancel("testrg", "managedInstance1", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCreateOrUpdateSamples.java new file mode 100644 index 000000000000..266e44b2cbef --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCreateOrUpdateSamples.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.AuthType; +import com.azure.resourcemanager.datamigration.models.AzureBlob; +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlMi; +import com.azure.resourcemanager.datamigration.models.ManagedServiceIdentity; +import com.azure.resourcemanager.datamigration.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; +import com.azure.resourcemanager.datamigration.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DatabaseMigrationsSqlMi CreateOrUpdate. + */ +public final class DatabaseMigrationsSqlMiCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationBlobManagedIdentity.json + */ + /** + * Sample code: Create or Update Database Migration resource from Azure Blob using Managed Identity. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceFromAzureBlobUsingManagedIdentity( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration().withSourceLocation( + new SourceLocation().withAzureBlob(new AzureBlob().withAuthType(AuthType.MANAGED_IDENTITY) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + new UserAssignedIdentity()))) + .withStorageAccountResourceId( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withBlobContainerName("test")))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .define("db1") + .withExistingManagedInstance("testrg", "managedInstance1") + .withProperties(new DatabaseMigrationPropertiesSqlMi().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/instance") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCutoverSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCutoverSamples.java new file mode 100644 index 000000000000..d7fb8f5f0a52 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiCutoverSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlMi Cutover. + */ +public final class DatabaseMigrationsSqlMiCutoverSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .cutover("testrg", "managedInstance1", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiGetSamples.java new file mode 100644 index 000000000000..918ee63afcba --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlMiGetSamples.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.generated; + +/** + * Samples for DatabaseMigrationsSqlMi Get. + */ +public final class DatabaseMigrationsSqlMiGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql MI database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlMiGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql MI database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlMIDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlMis() + .getWithResponse("testrg", "managedInstance1", "db1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCancelSamples.java new file mode 100644 index 000000000000..3ae5a75d04a2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCancelSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlVm Cancel. + */ +public final class DatabaseMigrationsSqlVmCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCancelDatabaseMigration.json + */ + /** + * Sample code: Stop ongoing migration for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + stopOngoingMigrationForTheDatabase(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .cancel("testrg", "testvm", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCreateOrUpdateSamples.java new file mode 100644 index 000000000000..fe69662fdbce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCreateOrUpdateSamples.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.BackupConfiguration; +import com.azure.resourcemanager.datamigration.models.DatabaseMigrationPropertiesSqlVm; +import com.azure.resourcemanager.datamigration.models.OfflineConfiguration; +import com.azure.resourcemanager.datamigration.models.SourceLocation; +import com.azure.resourcemanager.datamigration.models.SqlConnectionInformation; +import com.azure.resourcemanager.datamigration.models.SqlFileShare; +import com.azure.resourcemanager.datamigration.models.TargetLocation; + +/** + * Samples for DatabaseMigrationsSqlVm CreateOrUpdate. + */ +public final class DatabaseMigrationsSqlVmCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCreateOrUpdateDatabaseMigrationMAX.json + */ + /** + * Sample code: Create or Update Database Migration resource with Maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties(new DatabaseMigrationPropertiesSqlVm().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder"))) + .withOfflineConfiguration( + new OfflineConfiguration().withOffline(true).withLastBackupName("last_backup_file_name"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCreateOrUpdateDatabaseMigrationMIN.json + */ + /** + * Sample code: Create or Update Database Migration resource with Minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateDatabaseMigrationResourceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .define("db1") + .withExistingSqlVirtualMachine("testrg", "testvm") + .withProperties(new DatabaseMigrationPropertiesSqlVm().withScope( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm") + .withMigrationService( + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent") + .withSourceSqlConnection(new SqlConnectionInformation().withDataSource("aaa") + .withAuthentication("WindowsAuthentication") + .withUsername("bbb") + .withPassword("fakeTokenPlaceholder") + .withEncryptConnection(true) + .withTrustServerCertificate(true)) + .withSourceDatabaseName("aaa") + .withBackupConfiguration(new BackupConfiguration() + .withSourceLocation( + new SourceLocation().withFileShare(new SqlFileShare().withPath("C:\\aaa\\bbb\\ccc") + .withUsername("name") + .withPassword("fakeTokenPlaceholder"))) + .withTargetLocation( + new TargetLocation().withStorageAccountResourceId("account.database.windows.net") + .withAccountKey("fakeTokenPlaceholder")))) + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCutoverSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCutoverSamples.java new file mode 100644 index 000000000000..5a81502e29dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmCutoverSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationOperationInput; +import java.util.UUID; + +/** + * Samples for DatabaseMigrationsSqlVm Cutover. + */ +public final class DatabaseMigrationsSqlVmCutoverSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmCutoverDatabaseMigration.json + */ + /** + * Sample code: Cutover online migration operation for the database. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void cutoverOnlineMigrationOperationForTheDatabase( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .cutover("testrg", "testvm", "db1", new MigrationOperationInput().withMigrationOperationId( + UUID.fromString("4124fe90-d1b6-4b50-b4d9-46d02381f59a")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmGetSamples.java new file mode 100644 index 000000000000..708c3973a39a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/DatabaseMigrationsSqlVmGetSamples.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.generated; + +/** + * Samples for DatabaseMigrationsSqlVm Get. + */ +public final class DatabaseMigrationsSqlVmGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmGetDatabaseMigrationExpanded.json + */ + /** + * Sample code: Get Sql VM database Migration with the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlVMDatabaseMigrationWithTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .getWithResponse("testrg", "testvm", "db1", null, "MigrationStatusDetails", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * SqlVmGetDatabaseMigration.json + */ + /** + * Sample code: Get Sql VM database Migration without the expand parameter. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getSqlVMDatabaseMigrationWithoutTheExpandParameter( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.databaseMigrationsSqlVms() + .getWithResponse("testrg", "testvm", "db1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..339198289cb8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** + * Samples for Files CreateOrUpdate. + */ +public final class FilesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_CreateOrUpdate.json + */ + /** + * Sample code: Files_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .define("x114d023d8") + .withExistingProject("DmsSdkRg", "DmsSdkService", "DmsSdkProject") + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesDeleteSamples.java new file mode 100644 index 000000000000..e33e49f43aec --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for Files Delete. + */ +public final class FilesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Delete.json + */ + /** + * Sample code: Files_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesGetSamples.java new file mode 100644 index 000000000000..9b8162f0e153 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for Files Get. + */ +public final class FilesGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Get.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesListSamples.java new file mode 100644 index 000000000000..6255f8be5f17 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for Files List. + */ +public final class FilesListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_List.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files().list("DmsSdkRg", "DmsSdkService", "DmsSdkProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadSamples.java new file mode 100644 index 000000000000..e934a5219812 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for Files Read. + */ +public final class FilesReadSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Read.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .readWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadWriteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadWriteSamples.java new file mode 100644 index 000000000000..0880cbc4c6b5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesReadWriteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for Files ReadWrite. + */ +public final class FilesReadWriteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_ReadWrite.json + */ + /** + * Sample code: Files_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.files() + .readWriteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesUpdateSamples.java new file mode 100644 index 000000000000..0ac808107870 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/FilesUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +/** + * Samples for Files Update. + */ +public final class FilesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Files_Update.json + */ + /** + * Sample code: Files_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void filesUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + ProjectFile resource = manager.files() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "x114d023d8", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ProjectFileProperties().withFilePath("DmsSdkFilePath/DmsSdkFile.sql")) + .apply(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..47a7bc4f4b9f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesCreateOrUpdateSamples.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.generated; + +/** + * Samples for MigrationServices CreateOrUpdate. + */ +public final class MigrationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateMigrationServiceMIN.json + */ + /** + * Sample code: Create or Update Migration Service with minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateMigrationServiceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateMigrationServiceMAX.json + */ + /** + * Sample code: Create or Update Migration Service with maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateMigrationServiceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesDeleteSamples.java new file mode 100644 index 000000000000..87dfb687689b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for MigrationServices Delete. + */ +public final class MigrationServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteMigrationService.json + */ + /** + * Sample code: Delete Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().delete("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesGetByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b2c07efee94d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for MigrationServices GetByResourceGroup. + */ +public final class MigrationServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetMigrationService.json + */ + /** + * Sample code: Get Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices() + .getByResourceGroupWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..1cbf85aa4334 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for MigrationServices ListByResourceGroup. + */ +public final class MigrationServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListByResourceGroupMigrationService.json + */ + /** + * Sample code: Get Migration Services in the Resource Group. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getMigrationServicesInTheResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListMigrationsSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListMigrationsSamples.java new file mode 100644 index 000000000000..6a2999540d0e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListMigrationsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for MigrationServices ListMigrations. + */ +public final class MigrationServicesListMigrationsSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListMigrationsByMigrationService.json + */ + /** + * Sample code: List database migrations attached to the service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listDatabaseMigrationsAttachedToTheService( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().listMigrations("testrg", "testMigrationService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListSamples.java new file mode 100644 index 000000000000..0b9885ef0888 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for MigrationServices List. + */ +public final class MigrationServicesListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListBySubscriptionMigrationService.json + */ + /** + * Sample code: Get Services in the Subscriptions. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getServicesInTheSubscriptions(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.migrationServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesUpdateSamples.java new file mode 100644 index 000000000000..b87b5b0278cf --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/MigrationServicesUpdateSamples.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.generated; + +import com.azure.resourcemanager.datamigration.models.MigrationService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for MigrationServices Update. + */ +public final class MigrationServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * UpdateMigrationService.json + */ + /** + * Sample code: Update Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void updateMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + MigrationService resource = manager.migrationServices() + .getByResourceGroupWithResponse("testrg", "testagent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/OperationsListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/OperationsListSamples.java index 3e78d3faa21b..acf198eb2936 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/OperationsListSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/OperationsListSamples.java @@ -10,15 +10,16 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Operations_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListOperation.json */ /** - * Sample code: Operations_List. + * Sample code: Lists all of the available SQL Rest API operations. * * @param manager Entry point to DataMigrationManager. */ - public static void operationsList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + public static void listsAllOfTheAvailableSQLRestAPIOperations( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsCreateOrUpdateSamples.java index 48346edebea8..199f5b2517ec 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsCreateOrUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class ProjectsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Projects_CreateOrUpdate.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteSamples.java index 3b28d4f8b67e..b616f3ca438a 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteSamples.java @@ -10,8 +10,8 @@ public final class ProjectsDeleteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Delete. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Delete.json */ /** * Sample code: Projects_Delete. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsGetSamples.java index abebc5f6abfb..b2741b5bc85e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsGetSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsGetSamples.java @@ -10,7 +10,8 @@ public final class ProjectsGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Get.json */ /** * Sample code: Projects_Get. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListSamples.java similarity index 52% rename from sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListByResourceGroupSamples.java rename to sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListSamples.java index e706544051c7..70f862bb2ec4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListByResourceGroupSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsListSamples.java @@ -5,21 +5,20 @@ package com.azure.resourcemanager.datamigration.generated; /** - * Samples for Projects ListByResourceGroup. + * Samples for Projects List. */ -public final class ProjectsListByResourceGroupSamples { +public final class ProjectsListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_List.json */ /** - * Sample code: Projects_ListByResourceGroup. + * Sample code: Projects_List. * * @param manager Entry point to DataMigrationManager. */ - public static void - projectsListByResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.projects().listByResourceGroup("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); + public static void projectsList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.projects().list("DmsSdkRg", "DmsSdkService", com.azure.core.util.Context.NONE); } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsUpdateSamples.java index c825b3ce43b1..f801773deeea 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ProjectsUpdateSamples.java @@ -14,8 +14,8 @@ public final class ProjectsUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Projects_Update. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Projects_Update.json */ /** * Sample code: Projects_Update. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ResourceSkusListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ResourceSkusListSamples.java index 9519311af838..b2072c6ada8c 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ResourceSkusListSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ResourceSkusListSamples.java @@ -10,7 +10,7 @@ public final class ResourceSkusListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * ResourceSkus_ListSkus.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCancelSamples.java new file mode 100644 index 000000000000..ae1778cd11f8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCancelSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for ServiceTasks Cancel. + */ +public final class ServiceTasksCancelSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Cancel.json + */ + /** + * Sample code: Tasks_Cancel. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCancel(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .cancelWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f86235624afb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskProperties; +import com.azure.resourcemanager.datamigration.models.MySqlConnectionInfo; + +/** + * Samples for ServiceTasks CreateOrUpdate. + */ +public final class ServiceTasksCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_CreateOrUpdate.json + */ + /** + * Sample code: Tasks_CreateOrUpdate. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCreateOrUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .createOrUpdateWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", new ProjectTaskInner() + .withProperties(new ConnectToSourceMySqlTaskProperties().withInput(new ConnectToSourceMySqlTaskInput() + .withSourceConnectionInfo(new MySqlConnectionInfo().withServerName("localhost").withPort(3306)))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksDeleteSamples.java new file mode 100644 index 000000000000..ab034e9d5766 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for ServiceTasks Delete. + */ +public final class ServiceTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Delete.json + */ + /** + * Sample code: Tasks_Delete. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksDelete(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .deleteWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksGetSamples.java new file mode 100644 index 000000000000..b70819c6fb92 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for ServiceTasks Get. + */ +public final class ServiceTasksGetSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Get.json + */ + /** + * Sample code: Tasks_Get. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksGet(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .getWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksListSamples.java new file mode 100644 index 000000000000..5439480ef291 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for ServiceTasks List. + */ +public final class ServiceTasksListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_List.json + */ + /** + * Sample code: ServiceTasks_List. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void serviceTasksList(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks().list("DmsSdkRg", "DmsSdkService", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksUpdateSamples.java new file mode 100644 index 000000000000..ed21b9416f9a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServiceTasksUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskInput; +import com.azure.resourcemanager.datamigration.models.ConnectToSourceMySqlTaskProperties; +import com.azure.resourcemanager.datamigration.models.MySqlConnectionInfo; + +/** + * Samples for ServiceTasks Update. + */ +public final class ServiceTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ServiceTasks_Update.json + */ + /** + * Sample code: Tasks_Update. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksUpdate(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.serviceTasks() + .updateWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkTask", new ProjectTaskInner() + .withProperties(new ConnectToSourceMySqlTaskProperties().withInput(new ConnectToSourceMySqlTaskInput() + .withSourceConnectionInfo(new MySqlConnectionInfo().withServerName("localhost").withPort(3306)))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckChildrenNameAvailabilitySamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckChildrenNameAvailabilitySamples.java new file mode 100644 index 000000000000..885ed6ca24e0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckChildrenNameAvailabilitySamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** + * Samples for Services CheckChildrenNameAvailability. + */ +public final class ServicesCheckChildrenNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_CheckChildrenNameAvailability.json + */ + /** + * Sample code: Services_CheckChildrenNameAvailability. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + servicesCheckChildrenNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.services() + .checkChildrenNameAvailabilityWithResponse("DmsSdkRg", "DmsSdkService", + new NameAvailabilityRequest().withName("Task1").withType("tasks"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilitySamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilitySamples.java index f92eb2df07d4..aca567a4c175 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilitySamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilitySamples.java @@ -12,7 +12,7 @@ public final class ServicesCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Services_CheckNameAvailability.json */ /** @@ -23,7 +23,8 @@ public final class ServicesCheckNameAvailabilitySamples { public static void servicesCheckNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { manager.services() - .checkNameAvailabilityWithResponse("eastus", new NameAvailabilityRequest(), + .checkNameAvailabilityWithResponse("eastus", + new NameAvailabilityRequest().withName("DmsSdkService").withType("services"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusSamples.java index 5e5d7fe2ce3a..842aba4d46f7 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusSamples.java @@ -10,7 +10,7 @@ public final class ServicesCheckStatusSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Services_CheckStatus.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCreateOrUpdateSamples.java index cc8a5e5ef48a..439538d645a0 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCreateOrUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class ServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Services_CreateOrUpdate.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteSamples.java index dea69c65ffa7..3eca4a56391f 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteSamples.java @@ -10,8 +10,8 @@ public final class ServicesDeleteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Delete. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Delete.json */ /** * Sample code: Services_CreateOrUpdate. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesGetByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesGetByResourceGroupSamples.java index 30bac4407e19..40fd40b1e8e2 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesGetByResourceGroupSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesGetByResourceGroupSamples.java @@ -10,7 +10,8 @@ public final class ServicesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Get.json */ /** * Sample code: Services_CreateOrUpdate. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListByResourceGroupSamples.java index eb811427a2cb..35582ad98dfb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListByResourceGroupSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ServicesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Services_ListByResourceGroup.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSamples.java index a2de39809ea4..02a1f98ef820 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSamples.java @@ -10,8 +10,8 @@ public final class ServicesListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_List. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_List.json */ /** * Sample code: Services_List. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusSamples.java index 912727e2e73a..5ef420b2061e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusSamples.java @@ -10,8 +10,8 @@ public final class ServicesListSkusSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_ListSkus - * .json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_ListSkus.json */ /** * Sample code: Services_ListSkus. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilitySamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilitySamples.java deleted file mode 100644 index 78e5f4408452..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilitySamples.java +++ /dev/null @@ -1,29 +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.generated; - -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; - -/** - * Samples for Services NestedCheckNameAvailability. - */ -public final class ServicesNestedCheckNameAvailabilitySamples { - /* - * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ - * Services_NestedCheckNameAvailability.json - */ - /** - * Sample code: Services_NestedCheckNameAvailability. - * - * @param manager Entry point to DataMigrationManager. - */ - public static void - servicesNestedCheckNameAvailability(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { - manager.services() - .nestedCheckNameAvailabilityWithResponse("DmsSdkRg", "DmsSdkService", new NameAvailabilityRequest(), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStartSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStartSamples.java index 1b12b060198b..13834e85060e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStartSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStartSamples.java @@ -10,8 +10,8 @@ public final class ServicesStartSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Start. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Start.json */ /** * Sample code: Services_Start. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStopSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStopSamples.java index ff941472252a..5912aa462be8 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStopSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesStopSamples.java @@ -10,8 +10,8 @@ public final class ServicesStopSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Stop. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Stop.json */ /** * Sample code: Services_Stop. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesUpdateSamples.java index 1a9108f06621..3bd3edea4c89 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/ServicesUpdateSamples.java @@ -12,8 +12,8 @@ public final class ServicesUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Services_Update. - * json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Services_Update.json */ /** * Sample code: Services_CreateOrUpdate. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..bde159c5292e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesCreateOrUpdateSamples.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.generated; + +/** + * Samples for SqlMigrationServices CreateOrUpdate. + */ +public final class SqlMigrationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateSqlMigrationServiceMAX.json + */ + /** + * Sample code: Create or Update SQL Migration Service with maximum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateSQLMigrationServiceWithMaximumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } + + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * CreateOrUpdateSqlMigrationServiceMIN.json + */ + /** + * Sample code: Create or Update SQL Migration Service with minimum parameters. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void createOrUpdateSQLMigrationServiceWithMinimumParameters( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .define("testagent") + .withRegion("northeurope") + .withExistingResourceGroup("testrg") + .create(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteNodeSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteNodeSamples.java new file mode 100644 index 000000000000..ffa3e66a80fe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteNodeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.fluent.models.DeleteNodeInner; + +/** + * Samples for SqlMigrationServices DeleteNode. + */ +public final class SqlMigrationServicesDeleteNodeSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteIntegrationRuntimeNode.json + */ + /** + * Sample code: Delete the integration runtime node. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + deleteTheIntegrationRuntimeNode(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .deleteNodeWithResponse("testrg", "service1", + new DeleteNodeInner().withNodeName("nodeName").withIntegrationRuntimeName("IRName"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteSamples.java new file mode 100644 index 000000000000..6be2a0175889 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices Delete. + */ +public final class SqlMigrationServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * DeleteSqlMigrationService.json + */ + /** + * Sample code: Delete SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void deleteSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().delete("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesGetByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b4d3892a88e9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices GetByResourceGroup. + */ +public final class SqlMigrationServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetSqlMigrationService.json + */ + /** + * Sample code: Get Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void getMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .getByResourceGroupWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListAuthKeysSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListAuthKeysSamples.java new file mode 100644 index 000000000000..b8325a865e94 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListAuthKeysSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices ListAuthKeys. + */ +public final class SqlMigrationServicesListAuthKeysSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListAuthKeysSqlMigrationService.json + */ + /** + * Sample code: Retrieve the List of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + retrieveTheListOfAuthenticationKeys(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listAuthKeysWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListByResourceGroupSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListByResourceGroupSamples.java new file mode 100644 index 000000000000..dbb56f67fa3f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices ListByResourceGroup. + */ +public final class SqlMigrationServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListByResourceGroupSqlMigrationService.json + */ + /** + * Sample code: Get Migration Services in the Resource Group. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getMigrationServicesInTheResourceGroup(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMigrationsSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMigrationsSamples.java new file mode 100644 index 000000000000..fed55e49af6f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMigrationsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices ListMigrations. + */ +public final class SqlMigrationServicesListMigrationsSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListMigrationsBySqlMigrationService.json + */ + /** + * Sample code: List database migrations attached to the service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void listDatabaseMigrationsAttachedToTheService( + com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().listMigrations("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMonitoringDataSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMonitoringDataSamples.java new file mode 100644 index 000000000000..77a20fd7f6d3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListMonitoringDataSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices ListMonitoringData. + */ +public final class SqlMigrationServicesListMonitoringDataSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * GetMonitorDataSqlMigrationService.json + */ + /** + * Sample code: Retrieve the Monitoring Data. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void retrieveTheMonitoringData(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .listMonitoringDataWithResponse("testrg", "service1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListSamples.java new file mode 100644 index 000000000000..6559f25be9f4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +/** + * Samples for SqlMigrationServices List. + */ +public final class SqlMigrationServicesListSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * ListBySubscriptionSqlMigrationService.json + */ + /** + * Sample code: Get Services in the Subscriptions. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + getServicesInTheSubscriptions(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesRegenerateAuthKeysSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesRegenerateAuthKeysSamples.java new file mode 100644 index 000000000000..f03f26e34c14 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesRegenerateAuthKeysSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.generated; + +import com.azure.resourcemanager.datamigration.fluent.models.RegenAuthKeysInner; + +/** + * Samples for SqlMigrationServices RegenerateAuthKeys. + */ +public final class SqlMigrationServicesRegenerateAuthKeysSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * RegenAuthKeysSqlMigrationService.json + */ + /** + * Sample code: Regenerate the of Authentication Keys. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void + regenerateTheOfAuthenticationKeys(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.sqlMigrationServices() + .regenerateAuthKeysWithResponse("testrg", "service1", + new RegenAuthKeysInner().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesUpdateSamples.java new file mode 100644 index 000000000000..4f7b6971b64f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/SqlMigrationServicesUpdateSamples.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.generated; + +import com.azure.resourcemanager.datamigration.models.SqlMigrationService; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqlMigrationServices Update. + */ +public final class SqlMigrationServicesUpdateSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * UpdateSqlMigrationService.json + */ + /** + * Sample code: Update SQL Migration Service. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void updateSQLMigrationService(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + SqlMigrationService resource = manager.sqlMigrationServices() + .getByResourceGroupWithResponse("testrg", "testagent", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("mytag", "myval")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java index 7d0c5513ded9..b27d3231bf84 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCancelSamples.java @@ -10,7 +10,8 @@ public final class TasksCancelSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Cancel.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Cancel.json */ /** * Sample code: Tasks_Cancel. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.java new file mode 100644 index 000000000000..a4ccc0267b0d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCommandSamples.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.generated; + +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; + +/** + * Samples for Tasks Command. + */ +public final class TasksCommandSamples { + /* + * x-ms-original-file: + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Command.json + */ + /** + * Sample code: Tasks_Command. + * + * @param manager Entry point to DataMigrationManager. + */ + public static void tasksCommand(com.azure.resourcemanager.datamigration.DataMigrationManager manager) { + manager.tasks() + .commandWithResponse("DmsSdkRg", "DmsSdkService", "DmsSdkProject", "DmsSdkTask", + new MigrateSyncCompleteCommandProperties() + .withInput(new MigrateSyncCompleteCommandInput().withDatabaseName("TestDatabase")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java index 0ed72abaa883..1152eb47fbe4 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksCreateOrUpdateSamples.java @@ -15,7 +15,7 @@ public final class TasksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/ + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ * Tasks_CreateOrUpdate.json */ /** diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java index b6be0e230407..d1be0be442fb 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteSamples.java @@ -10,7 +10,8 @@ public final class TasksDeleteSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Delete.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Delete.json */ /** * Sample code: Tasks_Delete. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java index a128c4188c0d..f5ecd490911d 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksGetSamples.java @@ -10,7 +10,8 @@ public final class TasksGetSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Get.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Get.json */ /** * Sample code: Tasks_Get. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java index 432d8621baf1..93240d1c1177 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksListSamples.java @@ -10,7 +10,8 @@ public final class TasksListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_List.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_List.json */ /** * Sample code: Tasks_List. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java index 731d48ac24fe..625f1862b856 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/TasksUpdateSamples.java @@ -16,7 +16,8 @@ public final class TasksUpdateSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Tasks_Update.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Tasks_Update.json */ /** * Sample code: Tasks_Update. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java index 379633e2b602..1e97691d5804 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/samples/java/com/azure/resourcemanager/datamigration/generated/UsagesListSamples.java @@ -10,7 +10,8 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/datamigration/resource-manager/Microsoft.DataMigration/stable/2018-04-19/examples/Usages_List.json + * specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2025-03-15-preview/examples/ + * Usages_List.json */ /** * Sample code: Services_Usages. diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuCapacityTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuCapacityTests.java deleted file mode 100644 index 4670ee43b3db..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuCapacityTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; -import com.azure.resourcemanager.datamigration.models.ServiceScalability; -import org.junit.jupiter.api.Assertions; - -public final class AvailableServiceSkuCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableServiceSkuCapacity model = BinaryData - .fromString( - "{\"minimum\":1862600222,\"maximum\":2027059656,\"default\":1969125414,\"scaleType\":\"manual\"}") - .toObject(AvailableServiceSkuCapacity.class); - Assertions.assertEquals(1862600222, model.minimum()); - Assertions.assertEquals(2027059656, model.maximum()); - Assertions.assertEquals(1969125414, model.defaultProperty()); - Assertions.assertEquals(ServiceScalability.MANUAL, model.scaleType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableServiceSkuCapacity model = new AvailableServiceSkuCapacity().withMinimum(1862600222) - .withMaximum(2027059656) - .withDefaultProperty(1969125414) - .withScaleType(ServiceScalability.MANUAL); - model = BinaryData.fromObject(model).toObject(AvailableServiceSkuCapacity.class); - Assertions.assertEquals(1862600222, model.minimum()); - Assertions.assertEquals(2027059656, model.maximum()); - Assertions.assertEquals(1969125414, model.defaultProperty()); - Assertions.assertEquals(ServiceScalability.MANUAL, model.scaleType()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuInnerTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuInnerTests.java deleted file mode 100644 index 947a33f10d64..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuInnerTests.java +++ /dev/null @@ -1,53 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; -import com.azure.resourcemanager.datamigration.models.ServiceScalability; -import org.junit.jupiter.api.Assertions; - -public final class AvailableServiceSkuInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableServiceSkuInner model = BinaryData.fromString( - "{\"resourceType\":\"b\",\"sku\":{\"name\":\"msmjqulngsntn\",\"family\":\"bkzgcwrwclx\",\"size\":\"rljdouskcqv\",\"tier\":\"cr\"},\"capacity\":{\"minimum\":747491790,\"maximum\":1343054120,\"default\":1034535063,\"scaleType\":\"none\"}}") - .toObject(AvailableServiceSkuInner.class); - Assertions.assertEquals("b", model.resourceType()); - Assertions.assertEquals("msmjqulngsntn", model.sku().name()); - Assertions.assertEquals("bkzgcwrwclx", model.sku().family()); - Assertions.assertEquals("rljdouskcqv", model.sku().size()); - Assertions.assertEquals("cr", model.sku().tier()); - Assertions.assertEquals(747491790, model.capacity().minimum()); - Assertions.assertEquals(1343054120, model.capacity().maximum()); - Assertions.assertEquals(1034535063, model.capacity().defaultProperty()); - Assertions.assertEquals(ServiceScalability.NONE, model.capacity().scaleType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableServiceSkuInner model = new AvailableServiceSkuInner().withResourceType("b") - .withSku(new AvailableServiceSkuSku().withName("msmjqulngsntn") - .withFamily("bkzgcwrwclx") - .withSize("rljdouskcqv") - .withTier("cr")) - .withCapacity(new AvailableServiceSkuCapacity().withMinimum(747491790) - .withMaximum(1343054120) - .withDefaultProperty(1034535063) - .withScaleType(ServiceScalability.NONE)); - model = BinaryData.fromObject(model).toObject(AvailableServiceSkuInner.class); - Assertions.assertEquals("b", model.resourceType()); - Assertions.assertEquals("msmjqulngsntn", model.sku().name()); - Assertions.assertEquals("bkzgcwrwclx", model.sku().family()); - Assertions.assertEquals("rljdouskcqv", model.sku().size()); - Assertions.assertEquals("cr", model.sku().tier()); - Assertions.assertEquals(747491790, model.capacity().minimum()); - Assertions.assertEquals(1343054120, model.capacity().maximum()); - Assertions.assertEquals(1034535063, model.capacity().defaultProperty()); - Assertions.assertEquals(ServiceScalability.NONE, model.capacity().scaleType()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuSkuTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuSkuTests.java deleted file mode 100644 index 59eddf1dbb3f..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/AvailableServiceSkuSkuTests.java +++ /dev/null @@ -1,33 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; -import org.junit.jupiter.api.Assertions; - -public final class AvailableServiceSkuSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableServiceSkuSku model - = BinaryData.fromString("{\"name\":\"jbiksqrglssai\",\"family\":\"p\",\"size\":\"nzl\",\"tier\":\"fmppe\"}") - .toObject(AvailableServiceSkuSku.class); - Assertions.assertEquals("jbiksqrglssai", model.name()); - Assertions.assertEquals("p", model.family()); - Assertions.assertEquals("nzl", model.size()); - Assertions.assertEquals("fmppe", model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableServiceSkuSku model - = new AvailableServiceSkuSku().withName("jbiksqrglssai").withFamily("p").withSize("nzl").withTier("fmppe"); - model = BinaryData.fromObject(model).toObject(AvailableServiceSkuSku.class); - Assertions.assertEquals("jbiksqrglssai", model.name()); - Assertions.assertEquals("p", model.family()); - Assertions.assertEquals("nzl", model.size()); - Assertions.assertEquals("fmppe", model.tier()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupFileInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupFileInfoTests.java deleted file mode 100644 index 95f8a6b52b60..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupFileInfoTests.java +++ /dev/null @@ -1,34 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.BackupFileInfo; -import com.azure.resourcemanager.datamigration.models.BackupFileStatus; -import org.junit.jupiter.api.Assertions; - -public final class BackupFileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupFileInfo model = BinaryData - .fromString( - "{\"fileLocation\":\"kouknvudwtiu\",\"familySequenceNumber\":45967354,\"status\":\"Restoring\"}") - .toObject(BackupFileInfo.class); - Assertions.assertEquals("kouknvudwtiu", model.fileLocation()); - Assertions.assertEquals(45967354, model.familySequenceNumber()); - Assertions.assertEquals(BackupFileStatus.RESTORING, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupFileInfo model = new BackupFileInfo().withFileLocation("kouknvudwtiu") - .withFamilySequenceNumber(45967354) - .withStatus(BackupFileStatus.RESTORING); - model = BinaryData.fromObject(model).toObject(BackupFileInfo.class); - Assertions.assertEquals("kouknvudwtiu", model.fileLocation()); - Assertions.assertEquals(45967354, model.familySequenceNumber()); - Assertions.assertEquals(BackupFileStatus.RESTORING, model.status()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupSetInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupSetInfoTests.java deleted file mode 100644 index 53c5b473f2c8..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BackupSetInfoTests.java +++ /dev/null @@ -1,71 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.BackupFileInfo; -import com.azure.resourcemanager.datamigration.models.BackupFileStatus; -import com.azure.resourcemanager.datamigration.models.BackupSetInfo; -import com.azure.resourcemanager.datamigration.models.BackupType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BackupSetInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BackupSetInfo model = BinaryData.fromString( - "{\"backupSetId\":\"y\",\"firstLsn\":\"svexcsonpclhoco\",\"lastLsn\":\"lkevle\",\"lastModifiedTime\":\"2021-02-17T22:26:44Z\",\"backupType\":\"Partial\",\"listOfBackupFiles\":[{\"fileLocation\":\"mvfaxkffeiith\",\"familySequenceNumber\":63986979,\"status\":\"Restored\"},{\"fileLocation\":\"v\",\"familySequenceNumber\":516508763,\"status\":\"Restoring\"},{\"fileLocation\":\"bbzoggig\",\"familySequenceNumber\":2011180934,\"status\":\"Queued\"}],\"databaseName\":\"vjxxjnsp\",\"backupStartDate\":\"2021-07-31T00:27:15Z\",\"backupFinishedDate\":\"2021-09-23T06:50:39Z\",\"isBackupRestored\":true}") - .toObject(BackupSetInfo.class); - Assertions.assertEquals("y", model.backupSetId()); - Assertions.assertEquals("svexcsonpclhoco", model.firstLsn()); - Assertions.assertEquals("lkevle", model.lastLsn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T22:26:44Z"), model.lastModifiedTime()); - Assertions.assertEquals(BackupType.PARTIAL, model.backupType()); - Assertions.assertEquals("mvfaxkffeiith", model.listOfBackupFiles().get(0).fileLocation()); - Assertions.assertEquals(63986979, model.listOfBackupFiles().get(0).familySequenceNumber()); - Assertions.assertEquals(BackupFileStatus.RESTORED, model.listOfBackupFiles().get(0).status()); - Assertions.assertEquals("vjxxjnsp", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T00:27:15Z"), model.backupStartDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T06:50:39Z"), model.backupFinishedDate()); - Assertions.assertEquals(true, model.isBackupRestored()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BackupSetInfo model = new BackupSetInfo().withBackupSetId("y") - .withFirstLsn("svexcsonpclhoco") - .withLastLsn("lkevle") - .withLastModifiedTime(OffsetDateTime.parse("2021-02-17T22:26:44Z")) - .withBackupType(BackupType.PARTIAL) - .withListOfBackupFiles(Arrays.asList( - new BackupFileInfo().withFileLocation("mvfaxkffeiith") - .withFamilySequenceNumber(63986979) - .withStatus(BackupFileStatus.RESTORED), - new BackupFileInfo().withFileLocation("v") - .withFamilySequenceNumber(516508763) - .withStatus(BackupFileStatus.RESTORING), - new BackupFileInfo().withFileLocation("bbzoggig") - .withFamilySequenceNumber(2011180934) - .withStatus(BackupFileStatus.QUEUED))) - .withDatabaseName("vjxxjnsp") - .withBackupStartDate(OffsetDateTime.parse("2021-07-31T00:27:15Z")) - .withBackupFinishedDate(OffsetDateTime.parse("2021-09-23T06:50:39Z")) - .withIsBackupRestored(true); - model = BinaryData.fromObject(model).toObject(BackupSetInfo.class); - Assertions.assertEquals("y", model.backupSetId()); - Assertions.assertEquals("svexcsonpclhoco", model.firstLsn()); - Assertions.assertEquals("lkevle", model.lastLsn()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-17T22:26:44Z"), model.lastModifiedTime()); - Assertions.assertEquals(BackupType.PARTIAL, model.backupType()); - Assertions.assertEquals("mvfaxkffeiith", model.listOfBackupFiles().get(0).fileLocation()); - Assertions.assertEquals(63986979, model.listOfBackupFiles().get(0).familySequenceNumber()); - Assertions.assertEquals(BackupFileStatus.RESTORED, model.listOfBackupFiles().get(0).status()); - Assertions.assertEquals("vjxxjnsp", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T00:27:15Z"), model.backupStartDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T06:50:39Z"), model.backupFinishedDate()); - Assertions.assertEquals(true, model.isBackupRestored()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BlobShareTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BlobShareTests.java deleted file mode 100644 index 7e25283eafbf..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/BlobShareTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.BlobShare; -import org.junit.jupiter.api.Assertions; - -public final class BlobShareTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BlobShare model = BinaryData.fromString("{\"sasUri\":\"msjnygqdnfw\"}").toObject(BlobShare.class); - Assertions.assertEquals("msjnygqdnfw", model.sasUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BlobShare model = new BlobShare().withSasUri("msjnygqdnfw"); - model = BinaryData.fromObject(model).toObject(BlobShare.class); - Assertions.assertEquals("msjnygqdnfw", model.sasUri()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceNonSqlTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceNonSqlTaskOutputTests.java deleted file mode 100644 index d18ce6e4e625..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceNonSqlTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceNonSqlTaskOutput; - -public final class ConnectToSourceNonSqlTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceNonSqlTaskOutput model = BinaryData.fromString( - "{\"id\":\"w\",\"sourceServerBrandVersion\":\"sjttgzfbish\",\"serverProperties\":{\"serverPlatform\":\"hajdeyeamdpha\",\"serverName\":\"lpbuxwgipwhonowk\",\"serverVersion\":\"hwankixzbinjepu\",\"serverEdition\":\"mryw\",\"serverOperatingSystemVersion\":\"zoqftiyqzrnkcqvy\",\"serverDatabaseCount\":798441434},\"databases\":[\"lsicohoqqnwv\",\"ryavwhheunmmqh\"],\"validationErrors\":[{\"message\":\"konocu\",\"actionableMessage\":\"klyaxuconu\",\"filePath\":\"zf\",\"lineNumber\":\"eyp\",\"hResult\":1039817033,\"stackTrace\":\"jmwvvj\"}]}") - .toObject(ConnectToSourceNonSqlTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceNonSqlTaskOutput model = new ConnectToSourceNonSqlTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceNonSqlTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourcePostgreSqlSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourcePostgreSqlSyncTaskOutputTests.java deleted file mode 100644 index 29cc91a78da2..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourcePostgreSqlSyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourcePostgreSqlSyncTaskOutput; - -public final class ConnectToSourcePostgreSqlSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourcePostgreSqlSyncTaskOutput model = BinaryData.fromString( - "{\"id\":\"sncghkjeszz\",\"sourceServerVersion\":\"ijhtxf\",\"databases\":[\"bfs\"],\"sourceServerBrandVersion\":\"nehmpvecx\",\"validationErrors\":[{\"message\":\"bfqkkr\",\"actionableMessage\":\"pukgriwflzlfb\",\"filePath\":\"puz\",\"lineNumber\":\"ispnqzahmgkbrp\",\"hResult\":1687540865,\"stackTrace\":\"ibnuqqkpik\"},{\"message\":\"rgvtqag\",\"actionableMessage\":\"uynhijg\",\"filePath\":\"ebf\",\"lineNumber\":\"arbu\",\"hResult\":2136509867,\"stackTrace\":\"pnazzm\"},{\"message\":\"runmp\",\"actionableMessage\":\"tdbhrbnla\",\"filePath\":\"xmyskp\",\"lineNumber\":\"enbtkcxywny\",\"hResult\":917020287,\"stackTrace\":\"yn\"},{\"message\":\"idybyxczf\",\"actionableMessage\":\"haaxdbabphl\",\"filePath\":\"qlfktsths\",\"lineNumber\":\"ocmnyyazttbtwwrq\",\"hResult\":1833989004,\"stackTrace\":\"ckzywbiexzfeyue\"}]}") - .toObject(ConnectToSourcePostgreSqlSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourcePostgreSqlSyncTaskOutput model = new ConnectToSourcePostgreSqlSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToSourcePostgreSqlSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputAgentJobLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputAgentJobLevelTests.java deleted file mode 100644 index 07f66f0decf3..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputAgentJobLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceSqlServerTaskOutputAgentJobLevel; - -public final class ConnectToSourceSqlServerTaskOutputAgentJobLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceSqlServerTaskOutputAgentJobLevel model = BinaryData.fromString( - "{\"resultType\":\"AgentJobLevelOutput\",\"name\":\"lwn\",\"jobCategory\":\"hjdauwhvylwz\",\"isEnabled\":true,\"jobOwner\":\"xujznbmpowu\",\"lastExecutedOn\":\"2020-12-27T11:29:17Z\",\"migrationEligibility\":{\"isEligibleForMigration\":false,\"validationMessages\":[\"ualupjmkh\",\"xobbcswsrt\",\"riplrbpbewtg\"]},\"id\":\"gblcgwxzvlvq\"}") - .toObject(ConnectToSourceSqlServerTaskOutputAgentJobLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceSqlServerTaskOutputAgentJobLevel model = new ConnectToSourceSqlServerTaskOutputAgentJobLevel(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceSqlServerTaskOutputAgentJobLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputDatabaseLevelTests.java deleted file mode 100644 index ddc19a6a527d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceSqlServerTaskOutputDatabaseLevel; - -public final class ConnectToSourceSqlServerTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceSqlServerTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"name\":\"ywpnvjt\",\"sizeMB\":36.42197096477435,\"databaseFiles\":[{\"databaseName\":\"lfplp\",\"id\":\"xus\",\"logicalName\":\"pabgyeps\",\"physicalFullName\":\"tazqugxywpmueefj\",\"restoreFullName\":\"fqkquj\",\"fileType\":\"Filestream\",\"sizeMB\":41.04159272065815},{\"databaseName\":\"obglaocqxtcc\",\"id\":\"yudxytlmoy\",\"logicalName\":\"vwfudwpzntxhd\",\"physicalFullName\":\"lrqjbhckfr\",\"restoreFullName\":\"rxsbkyvp\",\"fileType\":\"Filestream\",\"sizeMB\":59.9483549965609},{\"databaseName\":\"p\",\"id\":\"afkuwb\",\"logicalName\":\"nwbmeh\",\"physicalFullName\":\"eyvjusrtslhspkde\",\"restoreFullName\":\"aofmxagkvtme\",\"fileType\":\"Filestream\",\"sizeMB\":98.9411334393605},{\"databaseName\":\"hvljuahaquh\",\"id\":\"hmdua\",\"logicalName\":\"exq\",\"physicalFullName\":\"fadmws\",\"restoreFullName\":\"r\",\"fileType\":\"Filestream\",\"sizeMB\":29.84185249566388}],\"compatibilityLevel\":\"CompatLevel120\",\"databaseState\":\"OfflineSecondary\",\"id\":\"misgwbnb\"}") - .toObject(ConnectToSourceSqlServerTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceSqlServerTaskOutputDatabaseLevel model = new ConnectToSourceSqlServerTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceSqlServerTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputLoginLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputLoginLevelTests.java deleted file mode 100644 index 5e202910faad..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputLoginLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceSqlServerTaskOutputLoginLevel; - -public final class ConnectToSourceSqlServerTaskOutputLoginLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceSqlServerTaskOutputLoginLevel model = BinaryData.fromString( - "{\"resultType\":\"LoginLevelOutput\",\"name\":\"ce\",\"loginType\":\"SqlLogin\",\"defaultDatabase\":\"jrwjueiotwm\",\"isEnabled\":false,\"migrationEligibility\":{\"isEligibleForMigration\":false,\"validationMessages\":[\"txnrjaw\"]},\"id\":\"wgxhn\"}") - .toObject(ConnectToSourceSqlServerTaskOutputLoginLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceSqlServerTaskOutputLoginLevel model = new ConnectToSourceSqlServerTaskOutputLoginLevel(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceSqlServerTaskOutputLoginLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTaskLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTaskLevelTests.java deleted file mode 100644 index 78a86e21617d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTaskLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceSqlServerTaskOutputTaskLevel; - -public final class ConnectToSourceSqlServerTaskOutputTaskLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceSqlServerTaskOutputTaskLevel model = BinaryData.fromString( - "{\"resultType\":\"TaskLevelOutput\",\"databases\":\"xbzpfzab\",\"logins\":\"cuh\",\"agentJobs\":\"tcty\",\"sourceServerVersion\":\"klbb\",\"sourceServerBrandVersion\":\"plwzbhvgyugu\",\"validationErrors\":[{\"message\":\"kfssxqukkf\",\"actionableMessage\":\"gmgsxnkjzkde\",\"filePath\":\"pvlopwiyighxpkd\",\"lineNumber\":\"baiuebbaumny\",\"hResult\":624396177,\"stackTrace\":\"deoj\"},{\"message\":\"bckhsmtxpsi\",\"actionableMessage\":\"tfhvpesapskrdqmh\",\"filePath\":\"dhtldwkyz\",\"lineNumber\":\"utknc\",\"hResult\":355088461,\"stackTrace\":\"svlxotogtwrup\"},{\"message\":\"xvnmicykvceov\",\"actionableMessage\":\"lo\",\"filePath\":\"oty\",\"lineNumber\":\"fcnj\",\"hResult\":534363981,\"stackTrace\":\"x\"}],\"id\":\"bttk\"}") - .toObject(ConnectToSourceSqlServerTaskOutputTaskLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceSqlServerTaskOutputTaskLevel model = new ConnectToSourceSqlServerTaskOutputTaskLevel(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceSqlServerTaskOutputTaskLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTests.java deleted file mode 100644 index e6533a4d3aae..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToSourceSqlServerTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToSourceSqlServerTaskOutput; - -public final class ConnectToSourceSqlServerTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToSourceSqlServerTaskOutput model - = BinaryData.fromString("{\"resultType\":\"ConnectToSourceSqlServerTaskOutput\",\"id\":\"nxytxh\"}") - .toObject(ConnectToSourceSqlServerTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToSourceSqlServerTaskOutput model = new ConnectToSourceSqlServerTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToSourceSqlServerTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForMySqlTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForMySqlTaskOutputTests.java deleted file mode 100644 index 6e4046359206..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForMySqlTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetAzureDbForMySqlTaskOutput; - -public final class ConnectToTargetAzureDbForMySqlTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToTargetAzureDbForMySqlTaskOutput model = BinaryData.fromString( - "{\"id\":\"txon\",\"serverVersion\":\"ts\",\"databases\":[\"cbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\"],\"targetServerBrandVersion\":\"ycnojvknmefqsg\",\"validationErrors\":[{\"message\":\"apj\",\"actionableMessage\":\"hpvgqz\",\"filePath\":\"rvxdjzlmw\",\"lineNumber\":\"kvugfhzovawjvzun\",\"hResult\":1486439488,\"stackTrace\":\"nnprn\"}]}") - .toObject(ConnectToTargetAzureDbForMySqlTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToTargetAzureDbForMySqlTaskOutput model = new ConnectToTargetAzureDbForMySqlTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToTargetAzureDbForMySqlTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTests.java deleted file mode 100644 index 8399c09d8645..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput; - -public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput model = BinaryData.fromString( - "{\"id\":\"hkfpbs\",\"targetServerVersion\":\"ofd\",\"databases\":[\"us\",\"ttouwaboekqvkel\",\"smv\"],\"targetServerBrandVersion\":\"wyjsflhhcaalnjix\",\"validationErrors\":[{\"message\":\"awjoyaqcslyjp\",\"actionableMessage\":\"idzyexznelixhnr\",\"filePath\":\"folhbnxknal\",\"lineNumber\":\"lp\",\"hResult\":809589965,\"stackTrace\":\"tpnapnyiropuhpig\"},{\"message\":\"gylgqgitxmedjvcs\",\"actionableMessage\":\"n\",\"filePath\":\"wncwzzhxgktrmg\",\"lineNumber\":\"napkteoellw\",\"hResult\":1750481006,\"stackTrace\":\"ygpfqb\"}]}") - .toObject(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput model - = new ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlDbTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlDbTaskOutputTests.java deleted file mode 100644 index 503d4358904b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlDbTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlDbTaskOutput; - -public final class ConnectToTargetSqlDbTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToTargetSqlDbTaskOutput model = BinaryData.fromString( - "{\"id\":\"grcfb\",\"databases\":\"rmfqjhhkxbpvj\",\"targetServerVersion\":\"jhxxjyn\",\"targetServerBrandVersion\":\"divkrt\"}") - .toObject(ConnectToTargetSqlDbTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToTargetSqlDbTaskOutput model = new ConnectToTargetSqlDbTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToTargetSqlDbTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMISyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMISyncTaskOutputTests.java deleted file mode 100644 index a8a8d0ce49e7..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMISyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlMISyncTaskOutput; - -public final class ConnectToTargetSqlMISyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToTargetSqlMISyncTaskOutput model = BinaryData.fromString( - "{\"targetServerVersion\":\"ayqigynduhav\",\"targetServerBrandVersion\":\"lkthu\",\"validationErrors\":[{\"message\":\"lbg\",\"actionableMessage\":\"duiertgcc\",\"filePath\":\"vaolpsslqlf\",\"lineNumber\":\"dnbbglzps\",\"hResult\":1295617641,\"stackTrace\":\"mcwyhzdxssadb\"},{\"message\":\"nvdfznuda\",\"actionableMessage\":\"vxzbncb\",\"filePath\":\"lpstdbhhxsrzdz\",\"lineNumber\":\"erscdntne\",\"hResult\":1072156994,\"stackTrace\":\"jmygtdsslswtmwer\"}]}") - .toObject(ConnectToTargetSqlMISyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToTargetSqlMISyncTaskOutput model = new ConnectToTargetSqlMISyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToTargetSqlMISyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMITaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMITaskOutputTests.java deleted file mode 100644 index 1bc44d08ea0a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ConnectToTargetSqlMITaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ConnectToTargetSqlMITaskOutput; - -public final class ConnectToTargetSqlMITaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectToTargetSqlMITaskOutput model = BinaryData.fromString( - "{\"id\":\"pe\",\"targetServerVersion\":\"wfbkrvrns\",\"targetServerBrandVersion\":\"hqjohxcrsbfova\",\"logins\":[\"uvwbhsqfs\"],\"agentJobs\":[\"gjb\",\"rxbpyb\",\"rfbjf\"],\"validationErrors\":[{\"message\":\"sotftpvj\",\"actionableMessage\":\"exilzznfqqnvwpmq\",\"filePath\":\"ruoujmk\",\"lineNumber\":\"hwqytj\",\"hResult\":778428037,\"stackTrace\":\"wj\"}]}") - .toObject(ConnectToTargetSqlMITaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectToTargetSqlMITaskOutput model = new ConnectToTargetSqlMITaskOutput(); - model = BinaryData.fromObject(model).toObject(ConnectToTargetSqlMITaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataIntegrityValidationResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataIntegrityValidationResultTests.java deleted file mode 100644 index 41da2fcdaa7f..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataIntegrityValidationResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DataIntegrityValidationResult; - -public final class DataIntegrityValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataIntegrityValidationResult model = BinaryData.fromString( - "{\"failedObjects\":{\"fzqlqhycavod\":\"ilcbtgnhnzeyqxtj\",\"nlrariaawiuagy\":\"gxdbeesmie\",\"ojocqwogf\":\"wqfbylyrfgiagt\",\"uxylfsbtkadpy\":\"zjvusfzldmo\"},\"validationErrors\":{\"text\":\"nbtgkbugrjqctoj\",\"severity\":\"Warning\"}}") - .toObject(DataIntegrityValidationResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataIntegrityValidationResult model = new DataIntegrityValidationResult(); - model = BinaryData.fromObject(model).toObject(DataIntegrityValidationResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataItemMigrationSummaryResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataItemMigrationSummaryResultTests.java deleted file mode 100644 index dff7f94aa95a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataItemMigrationSummaryResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DataItemMigrationSummaryResult; - -public final class DataItemMigrationSummaryResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataItemMigrationSummaryResult model = BinaryData.fromString( - "{\"name\":\"vlerchpqbmfpjba\",\"startedOn\":\"2021-07-26T01:12:04Z\",\"endedOn\":\"2021-06-03T19:53:15Z\",\"state\":\"Warning\",\"statusMessage\":\"spuunnoxyhkxgq\",\"itemsCount\":8879508928062968266,\"itemsCompletedCount\":5499837573865267014,\"errorPrefix\":\"oqcaaewdaomdj\",\"resultPrefix\":\"pjxxkzb\"}") - .toObject(DataItemMigrationSummaryResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataItemMigrationSummaryResult model = new DataItemMigrationSummaryResult(); - model = BinaryData.fromObject(model).toObject(DataItemMigrationSummaryResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataMigrationServiceStatusResponseInnerTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataMigrationServiceStatusResponseInnerTests.java deleted file mode 100644 index ba2f20bfa79b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DataMigrationServiceStatusResponseInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DataMigrationServiceStatusResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataMigrationServiceStatusResponseInner model = BinaryData.fromString( - "{\"agentVersion\":\"wzo\",\"status\":\"j\",\"vmSize\":\"elluwfziton\",\"supportedTaskTypes\":[\"fpjkjlxofp\",\"vhpfxxypininmay\"]}") - .toObject(DataMigrationServiceStatusResponseInner.class); - Assertions.assertEquals("wzo", model.agentVersion()); - Assertions.assertEquals("j", model.status()); - Assertions.assertEquals("elluwfziton", model.vmSize()); - Assertions.assertEquals("fpjkjlxofp", model.supportedTaskTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataMigrationServiceStatusResponseInner model - = new DataMigrationServiceStatusResponseInner().withAgentVersion("wzo") - .withStatus("j") - .withVmSize("elluwfziton") - .withSupportedTaskTypes(Arrays.asList("fpjkjlxofp", "vhpfxxypininmay")); - model = BinaryData.fromObject(model).toObject(DataMigrationServiceStatusResponseInner.class); - Assertions.assertEquals("wzo", model.agentVersion()); - Assertions.assertEquals("j", model.status()); - Assertions.assertEquals("elluwfziton", model.vmSize()); - Assertions.assertEquals("fpjkjlxofp", model.supportedTaskTypes().get(0)); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseBackupInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseBackupInfoTests.java deleted file mode 100644 index 22d80915a802..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseBackupInfoTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DatabaseBackupInfo; - -public final class DatabaseBackupInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseBackupInfo model = BinaryData.fromString( - "{\"databaseName\":\"cgbjbgdlfgt\",\"backupType\":\"DifferentialPartial\",\"backupFiles\":[\"quflqbctq\",\"amz\",\"rwd\"],\"position\":605506053,\"isDamaged\":false,\"isCompressed\":true,\"familyCount\":1179923211,\"backupFinishDate\":\"2021-03-27T03:11:25Z\"}") - .toObject(DatabaseBackupInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseBackupInfo model = new DatabaseBackupInfo(); - model = BinaryData.fromObject(model).toObject(DatabaseBackupInfo.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseFileInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseFileInfoTests.java deleted file mode 100644 index 9e355d082823..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseFileInfoTests.java +++ /dev/null @@ -1,45 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DatabaseFileInfo; -import com.azure.resourcemanager.datamigration.models.DatabaseFileType; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseFileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseFileInfo model = BinaryData.fromString( - "{\"databaseName\":\"ldawkzbaliourqha\",\"id\":\"uhashsfwx\",\"logicalName\":\"owzxcu\",\"physicalFullName\":\"cjooxdjebwpucwwf\",\"restoreFullName\":\"vbvmeu\",\"fileType\":\"Fulltext\",\"sizeMB\":18.24537793289579}") - .toObject(DatabaseFileInfo.class); - Assertions.assertEquals("ldawkzbaliourqha", model.databaseName()); - Assertions.assertEquals("uhashsfwx", model.id()); - Assertions.assertEquals("owzxcu", model.logicalName()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.physicalFullName()); - Assertions.assertEquals("vbvmeu", model.restoreFullName()); - Assertions.assertEquals(DatabaseFileType.FULLTEXT, model.fileType()); - Assertions.assertEquals(18.24537793289579D, model.sizeMB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseFileInfo model = new DatabaseFileInfo().withDatabaseName("ldawkzbaliourqha") - .withId("uhashsfwx") - .withLogicalName("owzxcu") - .withPhysicalFullName("cjooxdjebwpucwwf") - .withRestoreFullName("vbvmeu") - .withFileType(DatabaseFileType.FULLTEXT) - .withSizeMB(18.24537793289579D); - model = BinaryData.fromObject(model).toObject(DatabaseFileInfo.class); - Assertions.assertEquals("ldawkzbaliourqha", model.databaseName()); - Assertions.assertEquals("uhashsfwx", model.id()); - Assertions.assertEquals("owzxcu", model.logicalName()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.physicalFullName()); - Assertions.assertEquals("vbvmeu", model.restoreFullName()); - Assertions.assertEquals(DatabaseFileType.FULLTEXT, model.fileType()); - Assertions.assertEquals(18.24537793289579D, model.sizeMB()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseInfoTests.java deleted file mode 100644 index 10a0aad6d7e4..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseInfoTests.java +++ /dev/null @@ -1,25 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DatabaseInfo; -import org.junit.jupiter.api.Assertions; - -public final class DatabaseInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseInfo model - = BinaryData.fromString("{\"sourceDatabaseName\":\"umkdosvqwhbmd\"}").toObject(DatabaseInfo.class); - Assertions.assertEquals("umkdosvqwhbmd", model.sourceDatabaseName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseInfo model = new DatabaseInfo().withSourceDatabaseName("umkdosvqwhbmd"); - model = BinaryData.fromObject(model).toObject(DatabaseInfo.class); - Assertions.assertEquals("umkdosvqwhbmd", model.sourceDatabaseName()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseSummaryResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseSummaryResultTests.java deleted file mode 100644 index 042c9ee6dace..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/DatabaseSummaryResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.DatabaseSummaryResult; - -public final class DatabaseSummaryResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DatabaseSummaryResult model = BinaryData.fromString( - "{\"sizeMB\":7.652588154665596,\"name\":\"mfnczd\",\"startedOn\":\"2021-06-14T22:03:09Z\",\"endedOn\":\"2021-05-11T22:31:41Z\",\"state\":\"Warning\",\"statusMessage\":\"l\",\"itemsCount\":8856612047832221194,\"itemsCompletedCount\":1186256809003482579,\"errorPrefix\":\"evwrdnhfuk\",\"resultPrefix\":\"sjcswsmystuluqyp\"}") - .toObject(DatabaseSummaryResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DatabaseSummaryResult model = new DatabaseSummaryResult(); - model = BinaryData.fromObject(model).toObject(DatabaseSummaryResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ExecutionStatisticsTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ExecutionStatisticsTests.java deleted file mode 100644 index 6cac5deabe6e..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ExecutionStatisticsTests.java +++ /dev/null @@ -1,38 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ExecutionStatistics; -import com.azure.resourcemanager.datamigration.models.WaitStatistics; -import java.util.HashMap; -import java.util.Map; - -public final class ExecutionStatisticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExecutionStatistics model = BinaryData.fromString( - "{\"executionCount\":3484334770603775387,\"cpuTimeMs\":25.938547,\"elapsedTimeMs\":70.32886,\"waitStats\":{\"vzflbq\":{\"waitType\":\"hoxgsgbpf\",\"waitTimeMs\":58.59819,\"waitCount\":2174616740952150366}},\"hasErrors\":true,\"sqlErrors\":[\"lgafcqusrdve\"]}") - .toObject(ExecutionStatistics.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExecutionStatistics model = new ExecutionStatistics().withWaitStats(mapOf("vzflbq", new WaitStatistics())); - model = BinaryData.fromObject(model).toObject(ExecutionStatistics.class); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlSyncTaskOutputTests.java deleted file mode 100644 index 24db003a34bc..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlSyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.GetUserTablesSqlSyncTaskOutput; - -public final class GetUserTablesSqlSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GetUserTablesSqlSyncTaskOutput model = BinaryData.fromString( - "{\"databasesToSourceTables\":\"lkfg\",\"databasesToTargetTables\":\"dneu\",\"tableValidationErrors\":\"fphsdyhtozfikdow\",\"validationErrors\":[{\"message\":\"v\",\"actionableMessage\":\"xclvit\",\"filePath\":\"qzonosggbhcohf\",\"lineNumber\":\"sjnkal\",\"hResult\":391766197,\"stackTrace\":\"iswac\"},{\"message\":\"gdkz\",\"actionableMessage\":\"wkfvhqcrailvp\",\"filePath\":\"pfuflrw\",\"lineNumber\":\"hdlxyjrxsagafcn\",\"hResult\":781571507,\"stackTrace\":\"qapnedgfbcv\"}]}") - .toObject(GetUserTablesSqlSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetUserTablesSqlSyncTaskOutput model = new GetUserTablesSqlSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(GetUserTablesSqlSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlTaskOutputTests.java deleted file mode 100644 index 1ebd42eb41e4..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/GetUserTablesSqlTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.GetUserTablesSqlTaskOutput; - -public final class GetUserTablesSqlTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GetUserTablesSqlTaskOutput model = BinaryData.fromString( - "{\"id\":\"iyq\",\"databasesToTables\":\"uicpd\",\"validationErrors\":[{\"message\":\"zl\",\"actionableMessage\":\"bmpaxmodfvu\",\"filePath\":\"yw\",\"lineNumber\":\"pfvmwyhrfou\",\"hResult\":1120299710,\"stackTrace\":\"akcp\"},{\"message\":\"yzvqt\",\"actionableMessage\":\"ubex\",\"filePath\":\"zksmondj\",\"lineNumber\":\"uxvypomgkopkwh\",\"hResult\":10985850,\"stackTrace\":\"ajqgxy\"},{\"message\":\"ocmbqfqvmkcxoza\",\"actionableMessage\":\"helxprglya\",\"filePath\":\"dckcbc\",\"lineNumber\":\"jrjxgciqibrhosx\",\"hResult\":1655789286,\"stackTrace\":\"hzoymibmrqy\"},{\"message\":\"ahwfluszdtmhrk\",\"actionableMessage\":\"fyyvoq\",\"filePath\":\"piexpbtgiw\",\"lineNumber\":\"oenwashr\",\"hResult\":2130378751,\"stackTrace\":\"cnqxwbpokulpi\"}]}") - .toObject(GetUserTablesSqlTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GetUserTablesSqlTaskOutput model = new GetUserTablesSqlTaskOutput(); - model = BinaryData.fromObject(model).toObject(GetUserTablesSqlTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandInputTests.java deleted file mode 100644 index 356826d0f8e5..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandInputTests.java +++ /dev/null @@ -1,26 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMISyncCompleteCommandInput; -import org.junit.jupiter.api.Assertions; - -public final class MigrateMISyncCompleteCommandInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMISyncCompleteCommandInput model = BinaryData.fromString("{\"sourceDatabaseName\":\"kcglhslaz\"}") - .toObject(MigrateMISyncCompleteCommandInput.class); - Assertions.assertEquals("kcglhslaz", model.sourceDatabaseName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMISyncCompleteCommandInput model - = new MigrateMISyncCompleteCommandInput().withSourceDatabaseName("kcglhslaz"); - model = BinaryData.fromObject(model).toObject(MigrateMISyncCompleteCommandInput.class); - Assertions.assertEquals("kcglhslaz", model.sourceDatabaseName()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandOutputTests.java deleted file mode 100644 index 1f29fcc129d6..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMISyncCompleteCommandOutputTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMISyncCompleteCommandOutput; -import com.azure.resourcemanager.datamigration.models.ReportableException; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MigrateMISyncCompleteCommandOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMISyncCompleteCommandOutput model = BinaryData.fromString( - "{\"errors\":[{\"message\":\"gdtjixhbkuofqwey\",\"actionableMessage\":\"menevfyexfwh\",\"filePath\":\"cibvyvdcsitynn\",\"lineNumber\":\"mdectehfiqscjey\",\"hResult\":1797610507,\"stackTrace\":\"zrkgqhcjrefovg\"},{\"message\":\"qsl\",\"actionableMessage\":\"yvxyqjp\",\"filePath\":\"attpngjcrcczsq\",\"lineNumber\":\"hvmdajvnysounq\",\"hResult\":97546857,\"stackTrace\":\"oaeupfhyhltrpmo\"},{\"message\":\"mcmatuokthfuiu\",\"actionableMessage\":\"dsfcpkvxodpuoz\",\"filePath\":\"zydagfuaxbezyiuo\",\"lineNumber\":\"twhrdxwzywqsm\",\"hResult\":1243889101,\"stackTrace\":\"exim\"}]}") - .toObject(MigrateMISyncCompleteCommandOutput.class); - Assertions.assertEquals("menevfyexfwh", model.errors().get(0).actionableMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMISyncCompleteCommandOutput model = new MigrateMISyncCompleteCommandOutput() - .withErrors(Arrays.asList(new ReportableException().withActionableMessage("menevfyexfwh"), - new ReportableException().withActionableMessage("yvxyqjp"), - new ReportableException().withActionableMessage("dsfcpkvxodpuoz"))); - model = BinaryData.fromObject(model).toObject(MigrateMISyncCompleteCommandOutput.class); - Assertions.assertEquals("menevfyexfwh", model.errors().get(0).actionableMessage()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTests.java deleted file mode 100644 index c4d606220f03..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncDatabaseInputTests.java +++ /dev/null @@ -1,55 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncDatabaseInput model = BinaryData.fromString( - "{\"name\":\"cciuqgbdbutau\",\"targetDatabaseName\":\"btkuwhh\",\"migrationSetting\":{\"joxafnndlpi\":\"k\",\"kpw\":\"hkoymkcdyhbp\",\"jxywsuws\":\"reqnovvqfov\",\"aeneqnzarrwl\":\"rsndsytgadgvra\"},\"sourceSetting\":{\"bjibwwiftohq\":\"ijfqkacewiipfp\",\"plsaknynfsynljph\":\"vpuvks\"},\"targetSetting\":{\"eosjswsr\":\"xodlqiyntorzih\",\"qioxi\":\"slyzrpzbchckqq\",\"wyhqmibzyhwits\":\"suiizynkedyat\",\"wznm\":\"ypyynpcdpumnzg\"}}") - .toObject(MigrateMySqlAzureDbForMySqlSyncDatabaseInput.class); - Assertions.assertEquals("cciuqgbdbutau", model.name()); - Assertions.assertEquals("btkuwhh", model.targetDatabaseName()); - Assertions.assertEquals("k", model.migrationSetting().get("joxafnndlpi")); - Assertions.assertEquals("ijfqkacewiipfp", model.sourceSetting().get("bjibwwiftohq")); - Assertions.assertEquals("xodlqiyntorzih", model.targetSetting().get("eosjswsr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncDatabaseInput model - = new MigrateMySqlAzureDbForMySqlSyncDatabaseInput().withName("cciuqgbdbutau") - .withTargetDatabaseName("btkuwhh") - .withMigrationSetting(mapOf("joxafnndlpi", "k", "kpw", "hkoymkcdyhbp", "jxywsuws", "reqnovvqfov", - "aeneqnzarrwl", "rsndsytgadgvra")) - .withSourceSetting(mapOf("bjibwwiftohq", "ijfqkacewiipfp", "plsaknynfsynljph", "vpuvks")) - .withTargetSetting(mapOf("eosjswsr", "xodlqiyntorzih", "qioxi", "slyzrpzbchckqq", "wyhqmibzyhwits", - "suiizynkedyat", "wznm", "ypyynpcdpumnzg")); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncDatabaseInput.class); - Assertions.assertEquals("cciuqgbdbutau", model.name()); - Assertions.assertEquals("btkuwhh", model.targetDatabaseName()); - Assertions.assertEquals("k", model.migrationSetting().get("joxafnndlpi")); - Assertions.assertEquals("ijfqkacewiipfp", model.sourceSetting().get("bjibwwiftohq")); - Assertions.assertEquals("xodlqiyntorzih", model.targetSetting().get("eosjswsr")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTests.java deleted file mode 100644 index de630f25c797..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError; -import com.azure.resourcemanager.datamigration.models.SyncMigrationDatabaseErrorEvent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelErrorOutput\",\"errorMessage\":\"v\",\"events\":[{\"timestampString\":\"rvimjwosytxitcsk\",\"eventTypeString\":\"k\",\"eventText\":\"umiekkezzi\"},{\"timestampString\":\"ly\",\"eventTypeString\":\"hdgqggeb\",\"eventText\":\"nyga\"},{\"timestampString\":\"idb\",\"eventTypeString\":\"atpxl\",\"eventText\":\"xcyjmoadsuvarmy\"},{\"timestampString\":\"mjsjqb\",\"eventTypeString\":\"hyxxrwlycoduhpk\",\"eventText\":\"gymare\"}],\"id\":\"ajxq\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("v", model.errorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError model - = new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError().withErrorMessage("v") - .withEvents(Arrays.asList(new SyncMigrationDatabaseErrorEvent(), new SyncMigrationDatabaseErrorEvent(), - new SyncMigrationDatabaseErrorEvent(), new SyncMigrationDatabaseErrorEvent())); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("v", model.errorMessage()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTests.java deleted file mode 100644 index 85d760c81e3a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"databaseName\":\"ggxkallatmelwuip\",\"startedOn\":\"2021-10-19T09:34:04Z\",\"endedOn\":\"2021-06-05T01:20:37Z\",\"migrationState\":\"CANCELLED\",\"incomingChanges\":662578251116723063,\"appliedChanges\":1816332624383197418,\"cdcInsertCounter\":8713915720909474504,\"cdcDeleteCounter\":8913535749004515550,\"cdcUpdateCounter\":5279516661370439683,\"fullLoadCompletedTables\":5726286891049833981,\"fullLoadLoadingTables\":4856871253065990581,\"fullLoadQueuedTables\":3189288446104139819,\"fullLoadErroredTables\":199665361160492882,\"initializationCompleted\":true,\"latency\":5152017214547708245,\"id\":\"chea\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel model - = new MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTests.java deleted file mode 100644 index 050dbd234cda..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutputError; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"eaivxwczel\",\"actionableMessage\":\"irels\",\"filePath\":\"aenwabf\",\"lineNumber\":\"kl\",\"hResult\":1993086714,\"stackTrace\":\"jhwuaanozjos\"},\"id\":\"youlp\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputError model = new MigrateMySqlAzureDbForMySqlSyncTaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTests.java deleted file mode 100644 index 235724e77e7d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"startedOn\":\"2021-06-26T23:53:23Z\",\"endedOn\":\"2021-05-03T07:32:41Z\",\"sourceServerVersion\":\"wwrlkdmtncv\",\"sourceServer\":\"otllxdyhgsyo\",\"targetServerVersion\":\"gjltdtbnnhado\",\"targetServer\":\"rkvcikhnvpa\",\"id\":\"gxqquezik\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel model - = new MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTests.java deleted file mode 100644 index 2a4766374cd9..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel model = BinaryData.fromString( - "{\"resultType\":\"TableLevelOutput\",\"tableName\":\"fmtdaaygdvwvgp\",\"databaseName\":\"hgwxrtfudx\",\"cdcInsertCounter\":\"xg\",\"cdcUpdateCounter\":\"agvrvmnpkuk\",\"cdcDeleteCounter\":\"i\",\"fullLoadEstFinishTime\":\"2021-07-31T16:11:39Z\",\"fullLoadStartedOn\":\"2021-06-12T22:02:25Z\",\"fullLoadEndedOn\":\"2021-03-06T12:44:58Z\",\"fullLoadTotalRows\":5283233927495017901,\"state\":\"FULL_LOAD\",\"totalChangesApplied\":7729076180734759194,\"dataErrorsCounter\":6240929679987561692,\"lastModifiedTime\":\"2021-06-29T07:51:14Z\",\"id\":\"kfoqreyfkzikfj\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel model - = new MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTests.java deleted file mode 100644 index fa57daae02ce..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateMySqlAzureDbForMySqlSyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutput; - -public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutput model = BinaryData - .fromString("{\"resultType\":\"MigrateMySqlAzureDbForMySqlSyncTaskOutput\",\"id\":\"iknsorgjh\"}") - .toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateMySqlAzureDbForMySqlSyncTaskOutput model = new MigrateMySqlAzureDbForMySqlSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(MigrateMySqlAzureDbForMySqlSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTests.java deleted file mode 100644 index 9c0f6dd126bc..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput model = BinaryData.fromString( - "{\"name\":\"toego\",\"targetDatabaseName\":\"wbw\",\"migrationSetting\":{\"cmrvexzt\":\"z\",\"gsfraoyzkoow\":\"bt\",\"aldsy\":\"lmnguxaw\"},\"sourceSetting\":{\"ykutwpf\":\"imerqfobwyznk\",\"sd\":\"pagmhrskdsnf\",\"wpusdsttwvogv\":\"akgtdlmkkzevdlh\",\"qqmoaku\":\"bejdcn\"},\"targetSetting\":{\"enuuzkopbm\":\"jzrwrdgrtw\"}}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.class); - Assertions.assertEquals("toego", model.name()); - Assertions.assertEquals("wbw", model.targetDatabaseName()); - Assertions.assertEquals("z", model.migrationSetting().get("cmrvexzt")); - Assertions.assertEquals("imerqfobwyznk", model.sourceSetting().get("ykutwpf")); - Assertions.assertEquals("jzrwrdgrtw", model.targetSetting().get("enuuzkopbm")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput().withName("toego") - .withTargetDatabaseName("wbw") - .withMigrationSetting(mapOf("cmrvexzt", "z", "gsfraoyzkoow", "bt", "aldsy", "lmnguxaw")) - .withSourceSetting(mapOf("ykutwpf", "imerqfobwyznk", "sd", "pagmhrskdsnf", "wpusdsttwvogv", - "akgtdlmkkzevdlh", "qqmoaku", "bejdcn")) - .withTargetSetting(mapOf("enuuzkopbm", "jzrwrdgrtw")); - model = BinaryData.fromObject(model).toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.class); - Assertions.assertEquals("toego", model.name()); - Assertions.assertEquals("wbw", model.targetDatabaseName()); - Assertions.assertEquals("z", model.migrationSetting().get("cmrvexzt")); - Assertions.assertEquals("imerqfobwyznk", model.sourceSetting().get("ykutwpf")); - Assertions.assertEquals("jzrwrdgrtw", model.targetSetting().get("enuuzkopbm")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTests.java deleted file mode 100644 index 48a2450bee9b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError; -import com.azure.resourcemanager.datamigration.models.SyncMigrationDatabaseErrorEvent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelErrorOutput\",\"errorMessage\":\"xnavvwxq\",\"events\":[{\"timestampString\":\"unyowxwl\",\"eventTypeString\":\"jrkvfgbvfvpdbo\",\"eventText\":\"cizsjqlhkrribdei\"}],\"id\":\"ipqkghvxndzwm\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("xnavvwxq", model.errorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError().withErrorMessage("xnavvwxq") - .withEvents(Arrays.asList(new SyncMigrationDatabaseErrorEvent())); - model = BinaryData.fromObject(model) - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("xnavvwxq", model.errorMessage()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTests.java deleted file mode 100644 index ad9b72991eb5..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,25 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"databaseName\":\"woluhczbwemhair\",\"startedOn\":\"2021-08-12T10:49:45Z\",\"endedOn\":\"2021-02-28T06:47:58Z\",\"migrationState\":\"UNDEFINED\",\"incomingChanges\":2987884868949644497,\"appliedChanges\":3838902105692629413,\"cdcInsertCounter\":436762079027347032,\"cdcDeleteCounter\":3609708037389400316,\"cdcUpdateCounter\":6872107379910014616,\"fullLoadCompletedTables\":477850177551348326,\"fullLoadLoadingTables\":5986177445160524762,\"fullLoadQueuedTables\":5780541735101767778,\"fullLoadErroredTables\":5852678166783434118,\"initializationCompleted\":true,\"latency\":3065309169479098927,\"id\":\"ywemhzrn\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model) - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTests.java deleted file mode 100644 index 7dd5506b820f..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"aehtwd\",\"actionableMessage\":\"ftswibyrcdlbhsh\",\"filePath\":\"p\",\"lineNumber\":\"cstwity\",\"hResult\":56359046,\"stackTrace\":\"xccedcpnmdyodn\"},\"id\":\"xltjcvnhltiu\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTests.java deleted file mode 100644 index 68047bec0111..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,25 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"startedOn\":\"2021-03-01T11:30:13Z\",\"endedOn\":\"2020-12-20T18:42:28Z\",\"sourceServerVersion\":\"efozbhdms\",\"sourceServer\":\"mzqhoftrmaequi\",\"targetServerVersion\":\"xicslfao\",\"targetServer\":\"piyylhalnswhccsp\",\"id\":\"aivwitqscywu\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(); - model = BinaryData.fromObject(model) - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTests.java deleted file mode 100644 index cd0adef1461b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTests.java +++ /dev/null @@ -1,25 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel model = BinaryData.fromString( - "{\"resultType\":\"TableLevelOutput\",\"tableName\":\"dtclusiypb\",\"databaseName\":\"gytguslfead\",\"cdcInsertCounter\":1540620177587618900,\"cdcUpdateCounter\":4539196903443287081,\"cdcDeleteCounter\":8734080438498794448,\"fullLoadEstFinishTime\":\"2021-09-15T19:08:49Z\",\"fullLoadStartedOn\":\"2021-01-15T09:14:04Z\",\"fullLoadEndedOn\":\"2021-07-17T10:31:49Z\",\"fullLoadTotalRows\":5199624305945055059,\"state\":\"FULL_LOAD\",\"totalChangesApplied\":555329664048541191,\"dataErrorsCounter\":6507639588870568676,\"lastModifiedTime\":\"2021-08-16T07:12:35Z\",\"id\":\"vu\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(); - model = BinaryData.fromObject(model) - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTests.java deleted file mode 100644 index 7baa623dbfa5..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput; - -public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput model = BinaryData - .fromString("{\"resultType\":\"MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput\",\"id\":\"rfdwoyu\"}") - .toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput model - = new MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbDatabaseInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbDatabaseInputTests.java deleted file mode 100644 index 5f4f31fe441a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbDatabaseInputTests.java +++ /dev/null @@ -1,49 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbDatabaseInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MigrateSqlServerSqlDbDatabaseInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbDatabaseInput model = BinaryData.fromString( - "{\"name\":\"cv\",\"targetDatabaseName\":\"uwrbehwagoh\",\"makeSourceDbReadOnly\":false,\"tableMap\":{\"drjf\":\"mrqemvvhmx\"}}") - .toObject(MigrateSqlServerSqlDbDatabaseInput.class); - Assertions.assertEquals("cv", model.name()); - Assertions.assertEquals("uwrbehwagoh", model.targetDatabaseName()); - Assertions.assertEquals(false, model.makeSourceDbReadOnly()); - Assertions.assertEquals("mrqemvvhmx", model.tableMap().get("drjf")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbDatabaseInput model = new MigrateSqlServerSqlDbDatabaseInput().withName("cv") - .withTargetDatabaseName("uwrbehwagoh") - .withMakeSourceDbReadOnly(false) - .withTableMap(mapOf("drjf", "mrqemvvhmx")); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbDatabaseInput.class); - Assertions.assertEquals("cv", model.name()); - Assertions.assertEquals("uwrbehwagoh", model.targetDatabaseName()); - Assertions.assertEquals(false, model.makeSourceDbReadOnly()); - Assertions.assertEquals("mrqemvvhmx", model.tableMap().get("drjf")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncDatabaseInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncDatabaseInputTests.java deleted file mode 100644 index ed04fc2d32c8..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncDatabaseInputTests.java +++ /dev/null @@ -1,62 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MigrateSqlServerSqlDbSyncDatabaseInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncDatabaseInput model = BinaryData.fromString( - "{\"id\":\"xhojuj\",\"name\":\"pelmcuvhixbjxyf\",\"targetDatabaseName\":\"yl\",\"schemaName\":\"ool\",\"tableMap\":{\"iwkkbn\":\"p\",\"rd\":\"jrywvtylbfpnc\",\"htywubxcbihwq\":\"iwii\",\"wjchrdg\":\"nfdn\"},\"migrationSetting\":{\"ctondz\":\"xum\",\"tov\":\"luudfdlwggytsb\",\"irgne\":\"tgseinqfiufxqkn\"},\"sourceSetting\":{\"ojlpijnkrxf\":\"wqmsniffcdmqn\",\"nasx\":\"ddhcratizzr\",\"zq\":\"ft\",\"tw\":\"zh\"},\"targetSetting\":{\"yhmossxkkg\":\"ogczhonnxkrlg\",\"rghxjb\":\"h\",\"rnsvbuswd\":\"hqxvcxgfrpdsofbs\",\"ybycnunvj\":\"z\"}}") - .toObject(MigrateSqlServerSqlDbSyncDatabaseInput.class); - Assertions.assertEquals("xhojuj", model.id()); - Assertions.assertEquals("pelmcuvhixbjxyf", model.name()); - Assertions.assertEquals("yl", model.targetDatabaseName()); - Assertions.assertEquals("ool", model.schemaName()); - Assertions.assertEquals("p", model.tableMap().get("iwkkbn")); - Assertions.assertEquals("xum", model.migrationSetting().get("ctondz")); - Assertions.assertEquals("wqmsniffcdmqn", model.sourceSetting().get("ojlpijnkrxf")); - Assertions.assertEquals("ogczhonnxkrlg", model.targetSetting().get("yhmossxkkg")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncDatabaseInput model = new MigrateSqlServerSqlDbSyncDatabaseInput().withId("xhojuj") - .withName("pelmcuvhixbjxyf") - .withTargetDatabaseName("yl") - .withSchemaName("ool") - .withTableMap(mapOf("iwkkbn", "p", "rd", "jrywvtylbfpnc", "htywubxcbihwq", "iwii", "wjchrdg", "nfdn")) - .withMigrationSetting(mapOf("ctondz", "xum", "tov", "luudfdlwggytsb", "irgne", "tgseinqfiufxqkn")) - .withSourceSetting(mapOf("ojlpijnkrxf", "wqmsniffcdmqn", "nasx", "ddhcratizzr", "zq", "ft", "tw", "zh")) - .withTargetSetting( - mapOf("yhmossxkkg", "ogczhonnxkrlg", "rghxjb", "h", "rnsvbuswd", "hqxvcxgfrpdsofbs", "ybycnunvj", "z")); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncDatabaseInput.class); - Assertions.assertEquals("xhojuj", model.id()); - Assertions.assertEquals("pelmcuvhixbjxyf", model.name()); - Assertions.assertEquals("yl", model.targetDatabaseName()); - Assertions.assertEquals("ool", model.schemaName()); - Assertions.assertEquals("p", model.tableMap().get("iwkkbn")); - Assertions.assertEquals("xum", model.migrationSetting().get("ctondz")); - Assertions.assertEquals("wqmsniffcdmqn", model.sourceSetting().get("ojlpijnkrxf")); - Assertions.assertEquals("ogczhonnxkrlg", model.targetSetting().get("yhmossxkkg")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTests.java deleted file mode 100644 index e1324316443e..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.datamigration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutputDatabaseError; -import com.azure.resourcemanager.datamigration.models.SyncMigrationDatabaseErrorEvent; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputDatabaseError model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelErrorOutput\",\"errorMessage\":\"lhvygdyftu\",\"events\":[{\"timestampString\":\"nawjslbiwkojgcy\",\"eventTypeString\":\"sfmznbaeqphc\",\"eventText\":\"nrnrp\"},{\"timestampString\":\"huwrykqgaifm\",\"eventTypeString\":\"klbydv\",\"eventText\":\"bejdznxcv\"},{\"timestampString\":\"rhnj\",\"eventTypeString\":\"olvtnovqfzge\",\"eventText\":\"dftuljltduce\"},{\"timestampString\":\"tmczuomejwcwwqi\",\"eventTypeString\":\"nssxmojmsvpk\",\"eventText\":\"rvkwc\"}],\"id\":\"ql\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("lhvygdyftu", model.errorMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputDatabaseError model - = new MigrateSqlServerSqlDbSyncTaskOutputDatabaseError().withErrorMessage("lhvygdyftu") - .withEvents(Arrays.asList(new SyncMigrationDatabaseErrorEvent(), new SyncMigrationDatabaseErrorEvent(), - new SyncMigrationDatabaseErrorEvent(), new SyncMigrationDatabaseErrorEvent())); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class); - Assertions.assertEquals("lhvygdyftu", model.errorMessage()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTests.java deleted file mode 100644 index b42cc94ffaec..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel; - -public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"databaseName\":\"rbgyefry\",\"startedOn\":\"2020-12-31T10:27:06Z\",\"endedOn\":\"2020-12-23T00:32:06Z\",\"migrationState\":\"COMPLETING\",\"incomingChanges\":4840101300202582176,\"appliedChanges\":8471289836284639425,\"cdcInsertCounter\":3010570452569358162,\"cdcDeleteCounter\":8990215421896908005,\"cdcUpdateCounter\":159751123697381023,\"fullLoadCompletedTables\":5137668435695893633,\"fullLoadLoadingTables\":2629501177722827198,\"fullLoadQueuedTables\":5653362505207852709,\"fullLoadErroredTables\":3558320105963115980,\"initializationCompleted\":false,\"latency\":5370468529550046523,\"id\":\"cpqjlihhyu\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel model = new MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputErrorTests.java deleted file mode 100644 index 2f75ea70e7a7..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputErrorTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutputError; - -public final class MigrateSqlServerSqlDbSyncTaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"auutpwoqhihe\",\"actionableMessage\":\"g\",\"filePath\":\"pnfqntcyp\",\"lineNumber\":\"jv\",\"hResult\":1058520064,\"stackTrace\":\"wkslir\"},\"id\":\"zjxvydfcea\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputError model = new MigrateSqlServerSqlDbSyncTaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTests.java deleted file mode 100644 index e3e2e9068ebb..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel; - -public final class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"startedOn\":\"2021-04-20T09:20:24Z\",\"endedOn\":\"2021-11-21T11:52:27Z\",\"sourceServerVersion\":\"jzhpjbibgjmfx\",\"sourceServer\":\"vfcluyovwxnbkfe\",\"targetServerVersion\":\"xscyhwzdgirujbz\",\"targetServer\":\"mvzzbtdcqvp\",\"databaseCount\":1622829877,\"id\":\"jviylwdshfs\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel model - = new MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTableLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTableLevelTests.java deleted file mode 100644 index 29b8e754c6bf..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTableLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutputTableLevel; - -public final class MigrateSqlServerSqlDbSyncTaskOutputTableLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputTableLevel model = BinaryData.fromString( - "{\"resultType\":\"TableLevelOutput\",\"tableName\":\"skasdvlmfwdgzxu\",\"databaseName\":\"cvpa\",\"cdcInsertCounter\":6851254807622539389,\"cdcUpdateCounter\":3676878310633289124,\"cdcDeleteCounter\":2458010483108140715,\"fullLoadEstFinishTime\":\"2021-11-19T17:24:15Z\",\"fullLoadStartedOn\":\"2021-08-12T14:06:46Z\",\"fullLoadEndedOn\":\"2021-11-30T06:27:35Z\",\"fullLoadTotalRows\":5109471982198112557,\"state\":\"FULL_LOAD\",\"totalChangesApplied\":4175162265983348993,\"dataErrorsCounter\":1511206213026031817,\"lastModifiedTime\":\"2021-11-23T16:36:18Z\",\"id\":\"ublwpcesutrg\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutputTableLevel model = new MigrateSqlServerSqlDbSyncTaskOutputTableLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTests.java deleted file mode 100644 index 064d9e76dc0b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbSyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutput; - -public final class MigrateSqlServerSqlDbSyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutput model = BinaryData - .fromString("{\"resultType\":\"MigrateSqlServerSqlDbSyncTaskOutput\",\"id\":\"hyaomtbghhavgr\"}") - .toObject(MigrateSqlServerSqlDbSyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbSyncTaskOutput model = new MigrateSqlServerSqlDbSyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbSyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelTests.java deleted file mode 100644 index 20b21366f757..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputDatabaseLevel; - -public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"databaseName\":\"fi\",\"startedOn\":\"2021-01-17T17:19:37Z\",\"endedOn\":\"2021-01-10T04:07:58Z\",\"state\":\"None\",\"stage\":\"Backup\",\"statusMessage\":\"jchvcyy\",\"message\":\"fgdo\",\"numberOfObjects\":7467577489537815272,\"numberOfObjectsCompleted\":1284290883473857221,\"errorCount\":5632513146595394956,\"errorPrefix\":\"oqonma\",\"resultPrefix\":\"ekni\",\"exceptionsAndWarnings\":[{\"message\":\"vcimpev\",\"actionableMessage\":\"mblrrilbywd\",\"filePath\":\"miccwrwfscjfnyn\",\"lineNumber\":\"qujizdvo\",\"hResult\":918297012,\"stackTrace\":\"byowbblgyavutp\"},{\"message\":\"joxoism\",\"actionableMessage\":\"sbpimlq\",\"filePath\":\"jxkcgxxlxsff\",\"lineNumber\":\"vizqzdwl\",\"hResult\":946666624,\"stackTrace\":\"oupfgfb\"},{\"message\":\"ubdyhgk\",\"actionableMessage\":\"in\",\"filePath\":\"owzfttsttkt\",\"lineNumber\":\"hbq\",\"hResult\":485437008,\"stackTrace\":\"tgzukxitmmqt\"},{\"message\":\"qqxhrnxrxcpj\",\"actionableMessage\":\"savokqdzf\",\"filePath\":\"zivj\",\"lineNumber\":\"rqttbajlkatnw\",\"hResult\":1135299409,\"stackTrace\":\"pidkqqfkuvscxkdm\"}],\"objectSummary\":\"govibrxkpmloazu\",\"id\":\"ocbgoorbteoyb\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputDatabaseLevel model = new MigrateSqlServerSqlDbTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTests.java deleted file mode 100644 index 8e147118d951..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTests.java +++ /dev/null @@ -1,25 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult; - -public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult model = BinaryData.fromString( - "{\"resultType\":\"MigrationDatabaseLevelValidationOutput\",\"migrationId\":\"jtqedcgzulwmm\",\"sourceDatabaseName\":\"z\",\"targetDatabaseName\":\"rjvpglydzgkrvqee\",\"startedOn\":\"2021-04-21T12:17:49Z\",\"endedOn\":\"2021-06-13T13:06:44Z\",\"dataIntegrityValidationResult\":{\"failedObjects\":{\"wytpzdmovz\":\"t\",\"f\":\"fvaawzqa\",\"cokpv\":\"gzuriglaecxndt\",\"irclnpk\":\"mlqtmldgxob\"},\"validationErrors\":{\"text\":\"yzriykhy\",\"severity\":\"Warning\"}},\"schemaValidationResult\":{\"schemaDifferences\":{\"objectName\":\"b\",\"objectType\":\"Table\",\"updateAction\":\"ChangedOnTarget\"},\"validationErrors\":{\"text\":\"mxho\",\"severity\":\"Message\"},\"sourceDatabaseObjectCount\":{\"digumbnr\":8975628624340233031,\"zzp\":4054203991023073101},\"targetDatabaseObjectCount\":{\"sdzhezww\":6520171368318103183}},\"queryAnalysisValidationResult\":{\"queryResults\":{\"queryText\":\"yuvvfonkp\",\"statementsInBatch\":6342791013289994721,\"sourceResult\":{\"executionCount\":2954343681916155162,\"cpuTimeMs\":12.87508,\"elapsedTimeMs\":71.17668,\"waitStats\":{\"bvpoekrsgsgbdhu\":{\"waitType\":\"uwmncs\",\"waitTimeMs\":17.136473,\"waitCount\":9105800928046481710},\"mtk\":{\"waitType\":\"gnjdgkynscliqhz\",\"waitTimeMs\":57.665108,\"waitCount\":4338361443790117129},\"hfrbbc\":{\"waitType\":\"otppnv\",\"waitTimeMs\":19.275677,\"waitCount\":8293741546882547786}},\"hasErrors\":false,\"sqlErrors\":[\"tltdhlfkqojpy\",\"vgtrdcnifmzzs\"]},\"targetResult\":{\"executionCount\":2575726098394881595,\"cpuTimeMs\":78.772026,\"elapsedTimeMs\":1.0285735,\"waitStats\":{\"roud\":{\"waitType\":\"rafwgckhocxvdf\",\"waitTimeMs\":49.184036,\"waitCount\":9128214856149263586}},\"hasErrors\":false,\"sqlErrors\":[\"ehhr\",\"kbunzoz\",\"dhcxgkmoy\",\"cdyuibhmfdnbzyd\"]}},\"validationErrors\":{\"text\":\"fcjnaeoisrvhmgor\",\"severity\":\"Warning\"}},\"status\":\"Default\",\"id\":\"cvwmzhwplefa\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult model - = new MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(); - model - = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputErrorTests.java deleted file mode 100644 index f1eceac85495..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputErrorTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputError; - -public final class MigrateSqlServerSqlDbTaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"cybvpayakkudzpxg\",\"actionableMessage\":\"plmag\",\"filePath\":\"cyohpfkyrkdbd\",\"lineNumber\":\"ogsjkmnwqjno\",\"hResult\":1666235741,\"stackTrace\":\"hdd\"},\"id\":\"acegfnmntf\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputError model = new MigrateSqlServerSqlDbTaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputMigrationLevelTests.java deleted file mode 100644 index 8f3fabfdf68b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputMigrationLevel; - -public final class MigrateSqlServerSqlDbTaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"startedOn\":\"2021-04-28T14:16:46Z\",\"endedOn\":\"2021-02-13T21:15:59Z\",\"durationInSeconds\":6361635428329654747,\"status\":\"Configured\",\"statusMessage\":\"pmguaadraufac\",\"message\":\"ahzovajjziuxxp\",\"databases\":\"neekulfg\",\"databaseSummary\":\"qubkw\",\"migrationReport\":{\"id\":\"nrdsutujbazpjuoh\",\"reportUrl\":\"nyfln\"},\"sourceServerVersion\":\"wmd\",\"sourceServerBrandVersion\":\"wpklvxw\",\"targetServerVersion\":\"gdxpg\",\"targetServerBrandVersion\":\"chisze\",\"exceptionsAndWarnings\":[{\"message\":\"jcrxgibbdaxcon\",\"actionableMessage\":\"zauorsuk\",\"filePath\":\"wbqpl\",\"lineNumber\":\"vnuuepzl\",\"hResult\":461883011,\"stackTrace\":\"zsoldwey\"}],\"id\":\"dunvmnnrwrbiorkt\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputMigrationLevel model = new MigrateSqlServerSqlDbTaskOutputMigrationLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTableLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTableLevelTests.java deleted file mode 100644 index 2d71335c5e67..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTableLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputTableLevel; - -public final class MigrateSqlServerSqlDbTaskOutputTableLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputTableLevel model = BinaryData.fromString( - "{\"resultType\":\"TableLevelOutput\",\"objectName\":\"jxakv\",\"startedOn\":\"2021-04-29T04:08:31Z\",\"endedOn\":\"2021-10-14T00:29:48Z\",\"state\":\"Skipped\",\"statusMessage\":\"il\",\"itemsCount\":4699671859850911433,\"itemsCompletedCount\":5269658629842403913,\"errorPrefix\":\"xnyed\",\"resultPrefix\":\"gyvudtjuewbc\",\"id\":\"xuuwhcj\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputTableLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputTableLevel model = new MigrateSqlServerSqlDbTaskOutputTableLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputTableLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTests.java deleted file mode 100644 index 00e485eef417..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutput; - -public final class MigrateSqlServerSqlDbTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutput model - = BinaryData.fromString("{\"resultType\":\"MigrateSqlServerSqlDbTaskOutput\",\"id\":\"acoebj\"}") - .toObject(MigrateSqlServerSqlDbTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutput model = new MigrateSqlServerSqlDbTaskOutput(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputValidationResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputValidationResultTests.java deleted file mode 100644 index 465266f8f7ef..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlDbTaskOutputValidationResultTests.java +++ /dev/null @@ -1,40 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlDbTaskOutputValidationResult; -import com.azure.resourcemanager.datamigration.models.MigrationValidationDatabaseSummaryResult; -import java.util.HashMap; -import java.util.Map; - -public final class MigrateSqlServerSqlDbTaskOutputValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputValidationResult model = BinaryData.fromString( - "{\"resultType\":\"MigrationValidationOutput\",\"migrationId\":\"sgeivsiy\",\"summaryResults\":{\"yfm\":{\"id\":\"ncj\",\"migrationId\":\"onbzoggculapzwy\",\"sourceDatabaseName\":\"gogtqxepnylbf\",\"targetDatabaseName\":\"jlyjtlvofq\",\"startedOn\":\"2021-01-24T09:56:19Z\",\"endedOn\":\"2021-09-29T20:16:05Z\",\"status\":\"Completed\"},\"vuqeqvldspast\":{\"id\":\"uxrkjp\",\"migrationId\":\"w\",\"sourceDatabaseName\":\"zwiivwzjbhyzs\",\"targetDatabaseName\":\"rkambt\",\"startedOn\":\"2021-03-11T10:38:35Z\",\"endedOn\":\"2021-03-06T04:34:10Z\",\"status\":\"CompletedWithIssues\"}},\"status\":\"Initialized\",\"id\":\"dmflv\"}") - .toObject(MigrateSqlServerSqlDbTaskOutputValidationResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlDbTaskOutputValidationResult model = new MigrateSqlServerSqlDbTaskOutputValidationResult() - .withSummaryResults(mapOf("yfm", new MigrationValidationDatabaseSummaryResult(), "vuqeqvldspast", - new MigrationValidationDatabaseSummaryResult())); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlDbTaskOutputValidationResult.class); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevelTests.java deleted file mode 100644 index d635462d46ed..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel; - -public final class MigrateSqlServerSqlMISyncTaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"sourceDatabaseName\":\"qucwyhahnom\",\"migrationState\":\"LOG_SHIPPING_START\",\"startedOn\":\"2021-04-12T11:07:48Z\",\"endedOn\":\"2021-07-16T12:14:12Z\",\"fullBackupSetInfo\":{\"backupSetId\":\"vfuuru\",\"firstLsn\":\"we\",\"lastLsn\":\"wlalniexzsrzp\",\"lastModifiedTime\":\"2021-01-06T02:49:58Z\",\"backupType\":\"DifferentialDatabase\",\"listOfBackupFiles\":[{\"fileLocation\":\"wwpgdakchzyvlixq\",\"familySequenceNumber\":999395263,\"status\":\"Uploaded\"}],\"databaseName\":\"jibnxmysu\",\"backupStartDate\":\"2021-04-28T09:40:52Z\",\"backupFinishedDate\":\"2021-12-01T11:30:12Z\",\"isBackupRestored\":true},\"lastRestoredBackupSetInfo\":{\"backupSetId\":\"wijpsttexoqqpwc\",\"firstLsn\":\"ufmhrunc\",\"lastLsn\":\"mqspkcdqzhlctdd\",\"lastModifiedTime\":\"2021-11-11T00:02:33Z\",\"backupType\":\"DifferentialPartial\",\"listOfBackupFiles\":[{\"fileLocation\":\"chrqb\",\"familySequenceNumber\":1026325475,\"status\":\"Queued\"}],\"databaseName\":\"egy\",\"backupStartDate\":\"2020-12-23T19:39:20Z\",\"backupFinishedDate\":\"2021-11-25T15:39:13Z\",\"isBackupRestored\":true},\"activeBackupSets\":[{\"backupSetId\":\"qqoli\",\"firstLsn\":\"raiouaubrjtl\",\"lastLsn\":\"xfuojrn\",\"lastModifiedTime\":\"2021-03-17T19:20:44Z\",\"backupType\":\"Partial\",\"listOfBackupFiles\":[{\"fileLocation\":\"sccbiuimzd\",\"familySequenceNumber\":1790688457,\"status\":\"Restored\"},{\"fileLocation\":\"wmkyoqufdvruzsl\",\"familySequenceNumber\":15628056,\"status\":\"Arrived\"}],\"databaseName\":\"tfnmdx\",\"backupStartDate\":\"2021-08-06T02:53:59Z\",\"backupFinishedDate\":\"2020-12-22T17:50:01Z\",\"isBackupRestored\":true},{\"backupSetId\":\"eyzihgrky\",\"firstLsn\":\"zabs\",\"lastLsn\":\"fpphoj\",\"lastModifiedTime\":\"2021-07-27T14:18:56Z\",\"backupType\":\"Database\",\"listOfBackupFiles\":[{\"fileLocation\":\"gzfc\",\"familySequenceNumber\":396816762,\"status\":\"Arrived\"}],\"databaseName\":\"gbeglqgleo\",\"backupStartDate\":\"2021-11-28T14:13:42Z\",\"backupFinishedDate\":\"2021-01-07T16:18:42Z\",\"isBackupRestored\":false}],\"containerName\":\"ankrrfxee\",\"errorPrefix\":\"tijv\",\"isFullBackupRestored\":false,\"exceptionsAndWarnings\":[{\"message\":\"z\",\"actionableMessage\":\"q\",\"filePath\":\"aj\",\"lineNumber\":\"wxacevehj\",\"hResult\":1137200728,\"stackTrace\":\"oafgaoql\"}],\"id\":\"aeylinm\"}") - .toObject(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel model = new MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputErrorTests.java deleted file mode 100644 index 6fbd56298b6a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputErrorTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMISyncTaskOutputError; - -public final class MigrateSqlServerSqlMISyncTaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"xirpghriy\",\"actionableMessage\":\"q\",\"filePath\":\"hlqhykprlpy\",\"lineNumber\":\"uciqdsme\",\"hResult\":1077355180,\"stackTrace\":\"dfuxtya\"},\"id\":\"ibmi\"}") - .toObject(MigrateSqlServerSqlMISyncTaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputError model = new MigrateSqlServerSqlMISyncTaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMISyncTaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputMigrationLevelTests.java deleted file mode 100644 index beb0fa91547d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMISyncTaskOutputMigrationLevel; - -public final class MigrateSqlServerSqlMISyncTaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"databaseCount\":1941131866,\"state\":\"InProgress\",\"startedOn\":\"2021-04-17T06:33:56Z\",\"endedOn\":\"2021-02-12T06:23:20Z\",\"sourceServerName\":\"e\",\"sourceServerVersion\":\"eifzzhmk\",\"sourceServerBrandVersion\":\"svflyhbxcudch\",\"targetServerName\":\"srboldforobw\",\"targetServerVersion\":\"vizbfhfo\",\"targetServerBrandVersion\":\"acqpbtuodxesza\",\"databaseErrorCount\":1654037219,\"id\":\"awumuaslzkwrrwo\"}") - .toObject(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutputMigrationLevel model - = new MigrateSqlServerSqlMISyncTaskOutputMigrationLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputTests.java deleted file mode 100644 index 825c78a8bf11..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMISyncTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMISyncTaskOutput; - -public final class MigrateSqlServerSqlMISyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutput model - = BinaryData.fromString("{\"resultType\":\"MigrateSqlServerSqlMISyncTaskOutput\",\"id\":\"puuw\"}") - .toObject(MigrateSqlServerSqlMISyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMISyncTaskOutput model = new MigrateSqlServerSqlMISyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMISyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputAgentJobLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputAgentJobLevelTests.java deleted file mode 100644 index 38ac2f5a1082..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputAgentJobLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutputAgentJobLevel; - -public final class MigrateSqlServerSqlMITaskOutputAgentJobLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutputAgentJobLevel model = BinaryData.fromString( - "{\"resultType\":\"AgentJobLevelOutput\",\"name\":\"jsvg\",\"isEnabled\":true,\"state\":\"InProgress\",\"startedOn\":\"2021-04-04T11:10:54Z\",\"endedOn\":\"2021-06-12T13:45:08Z\",\"message\":\"t\",\"exceptionsAndWarnings\":[{\"message\":\"gc\",\"actionableMessage\":\"nfnw\",\"filePath\":\"tmvpdvjdhtt\",\"lineNumber\":\"efedxihchrphkm\",\"hResult\":881811798,\"stackTrace\":\"qnsdfzpbgtgky\"},{\"message\":\"dgh\",\"actionableMessage\":\"euutlwxezwzh\",\"filePath\":\"vbwnhhtq\",\"lineNumber\":\"ehgpp\",\"hResult\":1296977531,\"stackTrace\":\"hpfeoajvgcxtxjc\"},{\"message\":\"eafidltugsresm\",\"actionableMessage\":\"sjhoiftxfkfwegpr\",\"filePath\":\"tillucbiqtg\",\"lineNumber\":\"ohmcwsld\",\"hResult\":2048272060,\"stackTrace\":\"tpwb\"},{\"message\":\"lllibph\",\"actionableMessage\":\"zmizakakan\",\"filePath\":\"p\",\"lineNumber\":\"jzhajoy\",\"hResult\":2052287318,\"stackTrace\":\"muoyxprimr\"}],\"id\":\"pteecjme\"}") - .toObject(MigrateSqlServerSqlMITaskOutputAgentJobLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutputAgentJobLevel model = new MigrateSqlServerSqlMITaskOutputAgentJobLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutputAgentJobLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputDatabaseLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputDatabaseLevelTests.java deleted file mode 100644 index 073bb6e3ca5d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputDatabaseLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutputDatabaseLevel; - -public final class MigrateSqlServerSqlMITaskOutputDatabaseLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutputDatabaseLevel model = BinaryData.fromString( - "{\"resultType\":\"DatabaseLevelOutput\",\"databaseName\":\"vxei\",\"sizeMB\":39.23626946309939,\"state\":\"None\",\"stage\":\"Completed\",\"startedOn\":\"2021-10-15T15:55:41Z\",\"endedOn\":\"2021-08-04T15:57:37Z\",\"message\":\"ycxcktpiym\",\"exceptionsAndWarnings\":[{\"message\":\"eammxqiekkkzddr\",\"actionableMessage\":\"g\",\"filePath\":\"jbmxvavre\",\"lineNumber\":\"eesvecu\",\"hResult\":2054437598,\"stackTrace\":\"txsu\"},{\"message\":\"rtujwsawddjibab\",\"actionableMessage\":\"ititvtzeexavoxt\",\"filePath\":\"lecdmdqbw\",\"lineNumber\":\"pqtgsfjac\",\"hResult\":2096730025,\"stackTrace\":\"hxudbxvodht\"},{\"message\":\"irudh\",\"actionableMessage\":\"mes\",\"filePath\":\"dlpagzrcxfail\",\"lineNumber\":\"xwmdboxd\",\"hResult\":1260487269,\"stackTrace\":\"tufqobrjlnacgc\"},{\"message\":\"knh\",\"actionableMessage\":\"izvy\",\"filePath\":\"rzvul\",\"lineNumber\":\"aaeranokqgukk\",\"hResult\":531608748,\"stackTrace\":\"broyla\"}],\"id\":\"ulcdisdosf\"}") - .toObject(MigrateSqlServerSqlMITaskOutputDatabaseLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutputDatabaseLevel model = new MigrateSqlServerSqlMITaskOutputDatabaseLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutputDatabaseLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputErrorTests.java deleted file mode 100644 index 86646d2ae3cc..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputErrorTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutputError; - -public final class MigrateSqlServerSqlMITaskOutputErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutputError model = BinaryData.fromString( - "{\"resultType\":\"ErrorOutput\",\"error\":{\"message\":\"qyrxp\",\"actionableMessage\":\"cgq\",\"filePath\":\"ismjqfrddgamqu\",\"lineNumber\":\"os\",\"hResult\":303395076,\"stackTrace\":\"ivfcdisyirnx\"},\"id\":\"czexrxzbujrtrhqv\"}") - .toObject(MigrateSqlServerSqlMITaskOutputError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutputError model = new MigrateSqlServerSqlMITaskOutputError(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutputError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputLoginLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputLoginLevelTests.java deleted file mode 100644 index 39e9a3e73b8c..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputLoginLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutputLoginLevel; - -public final class MigrateSqlServerSqlMITaskOutputLoginLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutputLoginLevel model = BinaryData.fromString( - "{\"resultType\":\"LoginLevelOutput\",\"loginName\":\"ls\",\"state\":\"Stopped\",\"stage\":\"EstablishObjectPermissions\",\"startedOn\":\"2021-09-18T17:37:15Z\",\"endedOn\":\"2021-11-18T22:21:07Z\",\"message\":\"aumweoohguufu\",\"exceptionsAndWarnings\":[{\"message\":\"jathwtzo\",\"actionableMessage\":\"a\",\"filePath\":\"wm\",\"lineNumber\":\"mebwjscjpah\",\"hResult\":1860405842,\"stackTrace\":\"a\"},{\"message\":\"qxnmwmqt\",\"actionableMessage\":\"xyi\",\"filePath\":\"dt\",\"lineNumber\":\"cttadi\",\"hResult\":1122809689,\"stackTrace\":\"kmr\"},{\"message\":\"eekpndz\",\"actionableMessage\":\"pmudqmeqwig\",\"filePath\":\"bu\",\"lineNumber\":\"wyxebeybpmzz\",\"hResult\":1945693134,\"stackTrace\":\"fyaqitm\"}],\"id\":\"eioqaqhvse\"}") - .toObject(MigrateSqlServerSqlMITaskOutputLoginLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutputLoginLevel model = new MigrateSqlServerSqlMITaskOutputLoginLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutputLoginLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputMigrationLevelTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputMigrationLevelTests.java deleted file mode 100644 index 76aea804f72b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputMigrationLevelTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutputMigrationLevel; - -public final class MigrateSqlServerSqlMITaskOutputMigrationLevelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutputMigrationLevel model = BinaryData.fromString( - "{\"resultType\":\"MigrationLevelOutput\",\"startedOn\":\"2021-02-12T11:58:55Z\",\"endedOn\":\"2021-06-09T19:27:45Z\",\"status\":\"Running\",\"state\":\"Stopped\",\"agentJobs\":\"ijouwivkxoyzunb\",\"logins\":\"xrtikvcpwpgclr\",\"message\":\"vtsoxf\",\"serverRoleResults\":\"enxpmyyefr\",\"orphanedUsersInfo\":[{\"name\":\"nqqs\",\"databaseName\":\"waoqvmmb\"},{\"name\":\"qfr\",\"databaseName\":\"lkzmegnitgvkxl\"},{\"name\":\"qdrfegcealzxwhc\",\"databaseName\":\"symoyq\"},{\"name\":\"wigdi\",\"databaseName\":\"kbxgom\"}],\"databases\":\"juwasqvdaeyyguxa\",\"sourceServerVersion\":\"sqzhzbezkg\",\"sourceServerBrandVersion\":\"sidxasicdd\",\"targetServerVersion\":\"vjskgfmoc\",\"targetServerBrandVersion\":\"hpqgatjeaahhvj\",\"exceptionsAndWarnings\":[{\"message\":\"kzyb\",\"actionableMessage\":\"jid\",\"filePath\":\"syxkyxvxevblb\",\"lineNumber\":\"dnlj\",\"hResult\":1767709112,\"stackTrace\":\"uaulxunsm\"}],\"id\":\"nkppxynen\"}") - .toObject(MigrateSqlServerSqlMITaskOutputMigrationLevel.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutputMigrationLevel model = new MigrateSqlServerSqlMITaskOutputMigrationLevel(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutputMigrationLevel.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputTests.java deleted file mode 100644 index f520d3777253..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSqlServerSqlMITaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSqlServerSqlMITaskOutput; - -public final class MigrateSqlServerSqlMITaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSqlServerSqlMITaskOutput model - = BinaryData.fromString("{\"resultType\":\"MigrateSqlServerSqlMITaskOutput\",\"id\":\"dzgtil\"}") - .toObject(MigrateSqlServerSqlMITaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSqlServerSqlMITaskOutput model = new MigrateSqlServerSqlMITaskOutput(); - model = BinaryData.fromObject(model).toObject(MigrateSqlServerSqlMITaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandInputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandInputTests.java deleted file mode 100644 index 20ad219327ce..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandInputTests.java +++ /dev/null @@ -1,30 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class MigrateSyncCompleteCommandInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSyncCompleteCommandInput model = BinaryData - .fromString("{\"databaseName\":\"gnxkrxdqmidtth\",\"commitTimeStamp\":\"2021-10-23T16:11:35Z\"}") - .toObject(MigrateSyncCompleteCommandInput.class); - Assertions.assertEquals("gnxkrxdqmidtth", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T16:11:35Z"), model.commitTimestamp()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSyncCompleteCommandInput model = new MigrateSyncCompleteCommandInput().withDatabaseName("gnxkrxdqmidtth") - .withCommitTimestamp(OffsetDateTime.parse("2021-10-23T16:11:35Z")); - model = BinaryData.fromObject(model).toObject(MigrateSyncCompleteCommandInput.class); - Assertions.assertEquals("gnxkrxdqmidtth", model.databaseName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T16:11:35Z"), model.commitTimestamp()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandOutputTests.java deleted file mode 100644 index 0b46e230ea49..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrateSyncCompleteCommandOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandOutput; - -public final class MigrateSyncCompleteCommandOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrateSyncCompleteCommandOutput model = BinaryData.fromString( - "{\"id\":\"drabhjybige\",\"errors\":[{\"message\":\"bowsk\",\"actionableMessage\":\"yktz\",\"filePath\":\"u\",\"lineNumber\":\"wgqyw\",\"hResult\":1211142115,\"stackTrace\":\"vynhzgpphrcg\"},{\"message\":\"cocpecfvmmcoofsx\",\"actionableMessage\":\"evgbmqjq\",\"filePath\":\"c\",\"lineNumber\":\"mivkwlzuvcc\",\"hResult\":1704525857,\"stackTrace\":\"nbacfi\"}]}") - .toObject(MigrateSyncCompleteCommandOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrateSyncCompleteCommandOutput model = new MigrateSyncCompleteCommandOutput(); - model = BinaryData.fromObject(model).toObject(MigrateSyncCompleteCommandOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationEligibilityInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationEligibilityInfoTests.java deleted file mode 100644 index 5c4f7f253356..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationEligibilityInfoTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrationEligibilityInfo; - -public final class MigrationEligibilityInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationEligibilityInfo model - = BinaryData.fromString("{\"isEligibleForMigration\":true,\"validationMessages\":[\"bkpyc\"]}") - .toObject(MigrationEligibilityInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationEligibilityInfo model = new MigrationEligibilityInfo(); - model = BinaryData.fromObject(model).toObject(MigrationEligibilityInfo.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationReportResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationReportResultTests.java deleted file mode 100644 index a02cb4c9f2be..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationReportResultTests.java +++ /dev/null @@ -1,22 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrationReportResult; - -public final class MigrationReportResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationReportResult model = BinaryData.fromString("{\"id\":\"ywjhhgdnhx\",\"reportUrl\":\"ivfomiloxgg\"}") - .toObject(MigrationReportResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationReportResult model = new MigrationReportResult(); - model = BinaryData.fromObject(model).toObject(MigrationReportResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationDatabaseSummaryResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationDatabaseSummaryResultTests.java deleted file mode 100644 index 1cec999cb85a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationDatabaseSummaryResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrationValidationDatabaseSummaryResult; - -public final class MigrationValidationDatabaseSummaryResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationValidationDatabaseSummaryResult model = BinaryData.fromString( - "{\"id\":\"tmjlx\",\"migrationId\":\"ilozapeewchpxlk\",\"sourceDatabaseName\":\"kuziycsle\",\"targetDatabaseName\":\"f\",\"startedOn\":\"2021-03-03T22:41:41Z\",\"endedOn\":\"2021-10-09T00:13:12Z\",\"status\":\"CompletedWithIssues\"}") - .toObject(MigrationValidationDatabaseSummaryResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationValidationDatabaseSummaryResult model = new MigrationValidationDatabaseSummaryResult(); - model = BinaryData.fromObject(model).toObject(MigrationValidationDatabaseSummaryResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationOptionsTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationOptionsTests.java deleted file mode 100644 index a3e8236c56a7..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/MigrationValidationOptionsTests.java +++ /dev/null @@ -1,32 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.MigrationValidationOptions; -import org.junit.jupiter.api.Assertions; - -public final class MigrationValidationOptionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MigrationValidationOptions model = BinaryData.fromString( - "{\"enableSchemaValidation\":false,\"enableDataIntegrityValidation\":false,\"enableQueryAnalysisValidation\":true}") - .toObject(MigrationValidationOptions.class); - Assertions.assertEquals(false, model.enableSchemaValidation()); - Assertions.assertEquals(false, model.enableDataIntegrityValidation()); - Assertions.assertEquals(true, model.enableQueryAnalysisValidation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MigrationValidationOptions model = new MigrationValidationOptions().withEnableSchemaValidation(false) - .withEnableDataIntegrityValidation(false) - .withEnableQueryAnalysisValidation(true); - model = BinaryData.fromObject(model).toObject(MigrationValidationOptions.class); - Assertions.assertEquals(false, model.enableSchemaValidation()); - Assertions.assertEquals(false, model.enableDataIntegrityValidation()); - Assertions.assertEquals(true, model.enableQueryAnalysisValidation()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityRequestTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityRequestTests.java deleted file mode 100644 index 29de4464800a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityRequestTests.java +++ /dev/null @@ -1,27 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class NameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityRequest model = BinaryData.fromString("{\"name\":\"eablg\",\"type\":\"uticndvkaozwyif\"}") - .toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("eablg", model.name()); - Assertions.assertEquals("uticndvkaozwyif", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityRequest model = new NameAvailabilityRequest().withName("eablg").withType("uticndvkaozwyif"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityRequest.class); - Assertions.assertEquals("eablg", model.name()); - Assertions.assertEquals("uticndvkaozwyif", model.type()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityResponseInnerTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityResponseInnerTests.java deleted file mode 100644 index 6ecdeb32099b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/NameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; - -public final class NameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityResponseInner model - = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"rokft\"}") - .toObject(NameAvailabilityResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityResponseInner model = new NameAvailabilityResponseInner(); - model = BinaryData.fromObject(model).toObject(NameAvailabilityResponseInner.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OperationsListMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OperationsListMockTests.java deleted file mode 100644 index 791e20394a71..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OperationsListMockTests.java +++ /dev/null @@ -1,42 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.ServiceOperation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"rkmdyom\",\"display\":{\"provider\":\"bv\",\"resource\":\"hd\",\"operation\":\"rhpw\",\"description\":\"ddei\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rkmdyom", response.iterator().next().name()); - Assertions.assertEquals("bv", response.iterator().next().display().provider()); - Assertions.assertEquals("hd", response.iterator().next().display().resource()); - Assertions.assertEquals("rhpw", response.iterator().next().display().operation()); - Assertions.assertEquals("ddei", response.iterator().next().display().description()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OrphanedUserInfoTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OrphanedUserInfoTests.java deleted file mode 100644 index 40a92badf402..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/OrphanedUserInfoTests.java +++ /dev/null @@ -1,27 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.OrphanedUserInfo; -import org.junit.jupiter.api.Assertions; - -public final class OrphanedUserInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OrphanedUserInfo model = BinaryData.fromString("{\"name\":\"kpoc\",\"databaseName\":\"azyxoegukg\"}") - .toObject(OrphanedUserInfo.class); - Assertions.assertEquals("kpoc", model.name()); - Assertions.assertEquals("azyxoegukg", model.databaseName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OrphanedUserInfo model = new OrphanedUserInfo().withName("kpoc").withDatabaseName("azyxoegukg"); - model = BinaryData.fromObject(model).toObject(OrphanedUserInfo.class); - Assertions.assertEquals("kpoc", model.name()); - Assertions.assertEquals("azyxoegukg", model.databaseName()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteWithResponseMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteWithResponseMockTests.java deleted file mode 100644 index 941a1898e3fe..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ProjectsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ProjectsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.projects() - .deleteWithResponse("sjcitdigsxc", "gljplkeuachtomfl", "ytswfp", false, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryAnalysisValidationResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryAnalysisValidationResultTests.java deleted file mode 100644 index fc3f57e351f5..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryAnalysisValidationResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.QueryAnalysisValidationResult; - -public final class QueryAnalysisValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryAnalysisValidationResult model = BinaryData.fromString( - "{\"queryResults\":{\"queryText\":\"ubyjaffmmf\",\"statementsInBatch\":2587795512030568860,\"sourceResult\":{\"executionCount\":4220917598007271597,\"cpuTimeMs\":54.51402,\"elapsedTimeMs\":19.26564,\"waitStats\":{\"i\":{\"waitType\":\"lmetttwgdslqxi\",\"waitTimeMs\":50.135086,\"waitCount\":32649607287286313},\"o\":{\"waitType\":\"seypxiutcxapz\",\"waitTimeMs\":80.6901,\"waitCount\":4774882515981933052}},\"hasErrors\":false,\"sqlErrors\":[\"xslhvnhlabrqnkk\",\"jcjbt\"]},\"targetResult\":{\"executionCount\":6782486447609051353,\"cpuTimeMs\":24.034721,\"elapsedTimeMs\":49.24737,\"waitStats\":{\"kxzt\":{\"waitType\":\"jsto\",\"waitTimeMs\":61.182274,\"waitCount\":5829409872258968702}},\"hasErrors\":false,\"sqlErrors\":[\"lftidgfcwqmpim\"]}},\"validationErrors\":{\"text\":\"zhe\",\"severity\":\"Error\"}}") - .toObject(QueryAnalysisValidationResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryAnalysisValidationResult model = new QueryAnalysisValidationResult(); - model = BinaryData.fromObject(model).toObject(QueryAnalysisValidationResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryExecutionResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryExecutionResultTests.java deleted file mode 100644 index d0d731c4477e..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QueryExecutionResultTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.QueryExecutionResult; - -public final class QueryExecutionResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryExecutionResult model = BinaryData.fromString( - "{\"queryText\":\"ohu\",\"statementsInBatch\":4847614447596427316,\"sourceResult\":{\"executionCount\":2190117663402769089,\"cpuTimeMs\":47.507977,\"elapsedTimeMs\":24.088413,\"waitStats\":{\"hsnvkcdmxzrp\":{\"waitType\":\"awpfajnjwltlwtjj\",\"waitTimeMs\":82.267136,\"waitCount\":8518213803289262805}},\"hasErrors\":true,\"sqlErrors\":[\"nwiaaomyl\",\"eazulcs\",\"thwwn\"]},\"targetResult\":{\"executionCount\":384333340608707062,\"cpuTimeMs\":85.94433,\"elapsedTimeMs\":27.676027,\"waitStats\":{\"ewetwlyxgncxykxh\":{\"waitType\":\"ahfbous\",\"waitTimeMs\":31.302637,\"waitCount\":5746861636250891357},\"x\":{\"waitType\":\"h\",\"waitTimeMs\":57.31076,\"waitCount\":3977988438695654095},\"scjavftju\":{\"waitType\":\"bcporxvxcjzhqizx\",\"waitTimeMs\":81.577774,\"waitCount\":5031811828081098129}},\"hasErrors\":false,\"sqlErrors\":[\"k\",\"tgguwpijrajcivmm\",\"hfcf\",\"wrxgkneuvy\"]}}") - .toObject(QueryExecutionResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryExecutionResult model = new QueryExecutionResult(); - model = BinaryData.fromObject(model).toObject(QueryExecutionResult.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaInnerTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaInnerTests.java deleted file mode 100644 index f940e4bf7b4b..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaInnerTests.java +++ /dev/null @@ -1,41 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; -import com.azure.resourcemanager.datamigration.models.QuotaName; -import org.junit.jupiter.api.Assertions; - -public final class QuotaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaInner model = BinaryData.fromString( - "{\"currentValue\":40.19620424836534,\"id\":\"gjvtbv\",\"limit\":41.53201923659815,\"name\":{\"localizedValue\":\"nruj\",\"value\":\"uhmuouqfprwzwbn\"},\"unit\":\"itnwuizgazxufi\"}") - .toObject(QuotaInner.class); - Assertions.assertEquals(40.19620424836534D, model.currentValue()); - Assertions.assertEquals("gjvtbv", model.id()); - Assertions.assertEquals(41.53201923659815D, model.limit()); - Assertions.assertEquals("nruj", model.name().localizedValue()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.name().value()); - Assertions.assertEquals("itnwuizgazxufi", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaInner model = new QuotaInner().withCurrentValue(40.19620424836534D) - .withId("gjvtbv") - .withLimit(41.53201923659815D) - .withName(new QuotaName().withLocalizedValue("nruj").withValue("uhmuouqfprwzwbn")) - .withUnit("itnwuizgazxufi"); - model = BinaryData.fromObject(model).toObject(QuotaInner.class); - Assertions.assertEquals(40.19620424836534D, model.currentValue()); - Assertions.assertEquals("gjvtbv", model.id()); - Assertions.assertEquals(41.53201923659815D, model.limit()); - Assertions.assertEquals("nruj", model.name().localizedValue()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.name().value()); - Assertions.assertEquals("itnwuizgazxufi", model.unit()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaListTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaListTests.java deleted file mode 100644 index 383d54fed68a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaListTests.java +++ /dev/null @@ -1,45 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; -import com.azure.resourcemanager.datamigration.models.QuotaList; -import com.azure.resourcemanager.datamigration.models.QuotaName; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaList model = BinaryData.fromString( - "{\"value\":[{\"currentValue\":0.0161532366757422,\"id\":\"gmbmbexppbh\",\"limit\":42.629804332769986,\"name\":{\"localizedValue\":\"fpfpsalgbquxigj\",\"value\":\"gzjaoyfhrtxilne\"},\"unit\":\"ujysvle\"}],\"nextLink\":\"vfqawrlyxwjkcpr\"}") - .toObject(QuotaList.class); - Assertions.assertEquals(0.0161532366757422D, model.value().get(0).currentValue()); - Assertions.assertEquals("gmbmbexppbh", model.value().get(0).id()); - Assertions.assertEquals(42.629804332769986D, model.value().get(0).limit()); - Assertions.assertEquals("fpfpsalgbquxigj", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("gzjaoyfhrtxilne", model.value().get(0).name().value()); - Assertions.assertEquals("ujysvle", model.value().get(0).unit()); - Assertions.assertEquals("vfqawrlyxwjkcpr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaList model = new QuotaList().withValue(Arrays.asList(new QuotaInner().withCurrentValue(0.0161532366757422D) - .withId("gmbmbexppbh") - .withLimit(42.629804332769986D) - .withName(new QuotaName().withLocalizedValue("fpfpsalgbquxigj").withValue("gzjaoyfhrtxilne")) - .withUnit("ujysvle"))).withNextLink("vfqawrlyxwjkcpr"); - model = BinaryData.fromObject(model).toObject(QuotaList.class); - Assertions.assertEquals(0.0161532366757422D, model.value().get(0).currentValue()); - Assertions.assertEquals("gmbmbexppbh", model.value().get(0).id()); - Assertions.assertEquals(42.629804332769986D, model.value().get(0).limit()); - Assertions.assertEquals("fpfpsalgbquxigj", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("gzjaoyfhrtxilne", model.value().get(0).name().value()); - Assertions.assertEquals("ujysvle", model.value().get(0).unit()); - Assertions.assertEquals("vfqawrlyxwjkcpr", model.nextLink()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaNameTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaNameTests.java deleted file mode 100644 index b0a4c0e2064f..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/QuotaNameTests.java +++ /dev/null @@ -1,27 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.QuotaName; -import org.junit.jupiter.api.Assertions; - -public final class QuotaNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaName model - = BinaryData.fromString("{\"localizedValue\":\"ckyfih\",\"value\":\"idf\"}").toObject(QuotaName.class); - Assertions.assertEquals("ckyfih", model.localizedValue()); - Assertions.assertEquals("idf", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaName model = new QuotaName().withLocalizedValue("ckyfih").withValue("idf"); - model = BinaryData.fromObject(model).toObject(QuotaName.class); - Assertions.assertEquals("ckyfih", model.localizedValue()); - Assertions.assertEquals("idf", model.value()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ReportableExceptionTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ReportableExceptionTests.java deleted file mode 100644 index 7fe1c5f82ed9..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ReportableExceptionTests.java +++ /dev/null @@ -1,26 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ReportableException; -import org.junit.jupiter.api.Assertions; - -public final class ReportableExceptionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReportableException model = BinaryData.fromString( - "{\"message\":\"l\",\"actionableMessage\":\"x\",\"filePath\":\"qgtz\",\"lineNumber\":\"pnqbqqwxrjfe\",\"hResult\":61111335,\"stackTrace\":\"wsubisnja\"}") - .toObject(ReportableException.class); - Assertions.assertEquals("x", model.actionableMessage()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReportableException model = new ReportableException().withActionableMessage("x"); - model = BinaryData.fromObject(model).toObject(ReportableException.class); - Assertions.assertEquals("x", model.actionableMessage()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapabilitiesTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapabilitiesTests.java deleted file mode 100644 index dd576aede6a0..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapabilitiesTests.java +++ /dev/null @@ -1,22 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ResourceSkuCapabilities; - -public final class ResourceSkuCapabilitiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuCapabilities model - = BinaryData.fromString("{\"name\":\"k\",\"value\":\"f\"}").toObject(ResourceSkuCapabilities.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuCapabilities model = new ResourceSkuCapabilities(); - model = BinaryData.fromObject(model).toObject(ResourceSkuCapabilities.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapacityTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapacityTests.java deleted file mode 100644 index 2b1cbc9c46e9..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCapacityTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ResourceSkuCapacity; - -public final class ResourceSkuCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuCapacity model = BinaryData.fromString( - "{\"minimum\":4925998921332611681,\"maximum\":3554487366496283285,\"default\":8175859327820235456,\"scaleType\":\"Automatic\"}") - .toObject(ResourceSkuCapacity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuCapacity model = new ResourceSkuCapacity(); - model = BinaryData.fromObject(model).toObject(ResourceSkuCapacity.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCostsTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCostsTests.java deleted file mode 100644 index 287961c69ca4..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ResourceSkuCostsTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ResourceSkuCosts; - -public final class ResourceSkuCostsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSkuCosts model = BinaryData - .fromString("{\"meterID\":\"t\",\"quantity\":1479872096701654032,\"extendedUnit\":\"pjhulsuuvmkj\"}") - .toObject(ResourceSkuCosts.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuCosts model = new ResourceSkuCosts(); - model = BinaryData.fromObject(model).toObject(ResourceSkuCosts.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTests.java deleted file mode 100644 index fb690b5e82c9..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTests.java +++ /dev/null @@ -1,46 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.SchemaComparisonValidationResult; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchemaComparisonValidationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaComparisonValidationResult model = BinaryData.fromString( - "{\"schemaDifferences\":{\"objectName\":\"foj\",\"objectType\":\"StoredProcedures\",\"updateAction\":\"ChangedOnTarget\"},\"validationErrors\":{\"text\":\"lcplc\",\"severity\":\"Warning\"},\"sourceDatabaseObjectCount\":{\"lhzdsqtzb\":2890962376533436249,\"nowc\":2978941899472695406,\"gmvecactxmw\":4272824792965282046,\"yowc\":8777916003567598395},\"targetDatabaseObjectCount\":{\"ekqvgqouwif\":3485830042406616316,\"j\":4207965579372127021,\"vqikfxcvhrfsphu\":6985401659827260093}}") - .toObject(SchemaComparisonValidationResult.class); - Assertions.assertEquals(2890962376533436249L, model.sourceDatabaseObjectCount().get("lhzdsqtzb")); - Assertions.assertEquals(3485830042406616316L, model.targetDatabaseObjectCount().get("ekqvgqouwif")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaComparisonValidationResult model = new SchemaComparisonValidationResult() - .withSourceDatabaseObjectCount(mapOf("lhzdsqtzb", 2890962376533436249L, "nowc", 2978941899472695406L, - "gmvecactxmw", 4272824792965282046L, "yowc", 8777916003567598395L)) - .withTargetDatabaseObjectCount(mapOf("ekqvgqouwif", 3485830042406616316L, "j", 4207965579372127021L, - "vqikfxcvhrfsphu", 6985401659827260093L)); - model = BinaryData.fromObject(model).toObject(SchemaComparisonValidationResult.class); - Assertions.assertEquals(2890962376533436249L, model.sourceDatabaseObjectCount().get("lhzdsqtzb")); - Assertions.assertEquals(3485830042406616316L, model.targetDatabaseObjectCount().get("ekqvgqouwif")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTypeTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTypeTests.java deleted file mode 100644 index 9066f64aa8d8..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SchemaComparisonValidationResultTypeTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.SchemaComparisonValidationResultType; - -public final class SchemaComparisonValidationResultTypeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaComparisonValidationResultType model = BinaryData.fromString( - "{\"objectName\":\"rttikteusqc\",\"objectType\":\"StoredProcedures\",\"updateAction\":\"AddedOnTarget\"}") - .toObject(SchemaComparisonValidationResultType.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaComparisonValidationResultType model = new SchemaComparisonValidationResultType(); - model = BinaryData.fromObject(model).toObject(SchemaComparisonValidationResultType.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServerPropertiesTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServerPropertiesTests.java deleted file mode 100644 index 70675f235dd2..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServerPropertiesTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ServerProperties; - -public final class ServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerProperties model = BinaryData.fromString( - "{\"serverPlatform\":\"tcxsenhwlrs\",\"serverName\":\"rzpwvlqdqgbiq\",\"serverVersion\":\"ihkaetcktvfc\",\"serverEdition\":\"fsnkymuctq\",\"serverOperatingSystemVersion\":\"fbebrjcxer\",\"serverDatabaseCount\":1002767653}") - .toObject(ServerProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerProperties model = new ServerProperties(); - model = BinaryData.fromObject(model).toObject(ServerProperties.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationDisplayTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationDisplayTests.java deleted file mode 100644 index b3fe1d9cd5e5..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationDisplayTests.java +++ /dev/null @@ -1,35 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class ServiceOperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceOperationDisplay model = BinaryData.fromString( - "{\"provider\":\"c\",\"resource\":\"ierhhbcsglummaj\",\"operation\":\"aodxo\",\"description\":\"bdxkqpxokaj\"}") - .toObject(ServiceOperationDisplay.class); - Assertions.assertEquals("c", model.provider()); - Assertions.assertEquals("ierhhbcsglummaj", model.resource()); - Assertions.assertEquals("aodxo", model.operation()); - Assertions.assertEquals("bdxkqpxokaj", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceOperationDisplay model = new ServiceOperationDisplay().withProvider("c") - .withResource("ierhhbcsglummaj") - .withOperation("aodxo") - .withDescription("bdxkqpxokaj"); - model = BinaryData.fromObject(model).toObject(ServiceOperationDisplay.class); - Assertions.assertEquals("c", model.provider()); - Assertions.assertEquals("ierhhbcsglummaj", model.resource()); - Assertions.assertEquals("aodxo", model.operation()); - Assertions.assertEquals("bdxkqpxokaj", model.description()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationInnerTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationInnerTests.java deleted file mode 100644 index 90007536ad57..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationInnerTests.java +++ /dev/null @@ -1,39 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class ServiceOperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceOperationInner model = BinaryData.fromString( - "{\"name\":\"a\",\"display\":{\"provider\":\"idtqajzyu\",\"resource\":\"kudjkrlkhb\",\"operation\":\"fepgzgq\",\"description\":\"zloc\"}}") - .toObject(ServiceOperationInner.class); - Assertions.assertEquals("a", model.name()); - Assertions.assertEquals("idtqajzyu", model.display().provider()); - Assertions.assertEquals("kudjkrlkhb", model.display().resource()); - Assertions.assertEquals("fepgzgq", model.display().operation()); - Assertions.assertEquals("zloc", model.display().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceOperationInner model = new ServiceOperationInner().withName("a") - .withDisplay(new ServiceOperationDisplay().withProvider("idtqajzyu") - .withResource("kudjkrlkhb") - .withOperation("fepgzgq") - .withDescription("zloc")); - model = BinaryData.fromObject(model).toObject(ServiceOperationInner.class); - Assertions.assertEquals("a", model.name()); - Assertions.assertEquals("idtqajzyu", model.display().provider()); - Assertions.assertEquals("kudjkrlkhb", model.display().resource()); - Assertions.assertEquals("fepgzgq", model.display().operation()); - Assertions.assertEquals("zloc", model.display().description()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationListTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationListTests.java deleted file mode 100644 index fe52d1e796b6..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceOperationListTests.java +++ /dev/null @@ -1,55 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; -import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; -import com.azure.resourcemanager.datamigration.models.ServiceOperationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceOperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceOperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"zuhtymwisdkfthwx\",\"display\":{\"provider\":\"eiwaopvkmi\",\"resource\":\"mmxdcu\",\"operation\":\"fsrpymzidnse\",\"description\":\"xtbzsgfyccsne\"}},{\"name\":\"dwzjeiach\",\"display\":{\"provider\":\"sflnrosfqp\",\"resource\":\"ehzzvypyqrim\",\"operation\":\"npvswjdkirso\",\"description\":\"qxhcrmn\"}},{\"name\":\"jtckwhdso\",\"display\":{\"provider\":\"yip\",\"resource\":\"sqwpgrjb\",\"operation\":\"orcjxvsnby\",\"description\":\"abnmocpcyshu\"}}],\"nextLink\":\"afbljjgpbtoqcjmk\"}") - .toObject(ServiceOperationList.class); - Assertions.assertEquals("zuhtymwisdkfthwx", model.value().get(0).name()); - Assertions.assertEquals("eiwaopvkmi", model.value().get(0).display().provider()); - Assertions.assertEquals("mmxdcu", model.value().get(0).display().resource()); - Assertions.assertEquals("fsrpymzidnse", model.value().get(0).display().operation()); - Assertions.assertEquals("xtbzsgfyccsne", model.value().get(0).display().description()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceOperationList model = new ServiceOperationList().withValue(Arrays.asList( - new ServiceOperationInner().withName("zuhtymwisdkfthwx") - .withDisplay(new ServiceOperationDisplay().withProvider("eiwaopvkmi") - .withResource("mmxdcu") - .withOperation("fsrpymzidnse") - .withDescription("xtbzsgfyccsne")), - new ServiceOperationInner().withName("dwzjeiach") - .withDisplay(new ServiceOperationDisplay().withProvider("sflnrosfqp") - .withResource("ehzzvypyqrim") - .withOperation("npvswjdkirso") - .withDescription("qxhcrmn")), - new ServiceOperationInner().withName("jtckwhdso") - .withDisplay(new ServiceOperationDisplay().withProvider("yip") - .withResource("sqwpgrjb") - .withOperation("orcjxvsnby") - .withDescription("abnmocpcyshu")))) - .withNextLink("afbljjgpbtoqcjmk"); - model = BinaryData.fromObject(model).toObject(ServiceOperationList.class); - Assertions.assertEquals("zuhtymwisdkfthwx", model.value().get(0).name()); - Assertions.assertEquals("eiwaopvkmi", model.value().get(0).display().provider()); - Assertions.assertEquals("mmxdcu", model.value().get(0).display().resource()); - Assertions.assertEquals("fsrpymzidnse", model.value().get(0).display().operation()); - Assertions.assertEquals("xtbzsgfyccsne", model.value().get(0).display().description()); - Assertions.assertEquals("afbljjgpbtoqcjmk", model.nextLink()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuListTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuListTests.java deleted file mode 100644 index 18898e598c56..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuListTests.java +++ /dev/null @@ -1,59 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuSku; -import com.azure.resourcemanager.datamigration.models.ServiceScalability; -import com.azure.resourcemanager.datamigration.models.ServiceSkuList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSkuListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSkuList model = BinaryData.fromString( - "{\"value\":[{\"resourceType\":\"bkpodepooginuv\",\"sku\":{\"name\":\"heognarxzxtheo\",\"family\":\"si\",\"size\":\"evcciqihnhun\",\"tier\":\"wjzrnfygxgisp\"},\"capacity\":{\"minimum\":234245718,\"maximum\":1938175770,\"default\":1277339929,\"scaleType\":\"none\"}}],\"nextLink\":\"ljofxqeofjaeqjh\"}") - .toObject(ServiceSkuList.class); - Assertions.assertEquals("bkpodepooginuv", model.value().get(0).resourceType()); - Assertions.assertEquals("heognarxzxtheo", model.value().get(0).sku().name()); - Assertions.assertEquals("si", model.value().get(0).sku().family()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).sku().size()); - Assertions.assertEquals("wjzrnfygxgisp", model.value().get(0).sku().tier()); - Assertions.assertEquals(234245718, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(1938175770, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(1277339929, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(ServiceScalability.NONE, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("ljofxqeofjaeqjh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSkuList model = new ServiceSkuList() - .withValue(Arrays.asList(new AvailableServiceSkuInner().withResourceType("bkpodepooginuv") - .withSku(new AvailableServiceSkuSku().withName("heognarxzxtheo") - .withFamily("si") - .withSize("evcciqihnhun") - .withTier("wjzrnfygxgisp")) - .withCapacity(new AvailableServiceSkuCapacity().withMinimum(234245718) - .withMaximum(1938175770) - .withDefaultProperty(1277339929) - .withScaleType(ServiceScalability.NONE)))) - .withNextLink("ljofxqeofjaeqjh"); - model = BinaryData.fromObject(model).toObject(ServiceSkuList.class); - Assertions.assertEquals("bkpodepooginuv", model.value().get(0).resourceType()); - Assertions.assertEquals("heognarxzxtheo", model.value().get(0).sku().name()); - Assertions.assertEquals("si", model.value().get(0).sku().family()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).sku().size()); - Assertions.assertEquals("wjzrnfygxgisp", model.value().get(0).sku().tier()); - Assertions.assertEquals(234245718, model.value().get(0).capacity().minimum()); - Assertions.assertEquals(1938175770, model.value().get(0).capacity().maximum()); - Assertions.assertEquals(1277339929, model.value().get(0).capacity().defaultProperty()); - Assertions.assertEquals(ServiceScalability.NONE, model.value().get(0).capacity().scaleType()); - Assertions.assertEquals("ljofxqeofjaeqjh", model.nextLink()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuTests.java deleted file mode 100644 index 885e7dd47dc1..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServiceSkuTests.java +++ /dev/null @@ -1,38 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ServiceSku; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSku model = BinaryData.fromString( - "{\"name\":\"phlxa\",\"tier\":\"thqt\",\"family\":\"qjbpfzfsin\",\"size\":\"v\",\"capacity\":1595507269}") - .toObject(ServiceSku.class); - Assertions.assertEquals("phlxa", model.name()); - Assertions.assertEquals("thqt", model.tier()); - Assertions.assertEquals("qjbpfzfsin", model.family()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals(1595507269, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSku model = new ServiceSku().withName("phlxa") - .withTier("thqt") - .withFamily("qjbpfzfsin") - .withSize("v") - .withCapacity(1595507269); - model = BinaryData.fromObject(model).toObject(ServiceSku.class); - Assertions.assertEquals("phlxa", model.name()); - Assertions.assertEquals("thqt", model.tier()); - Assertions.assertEquals("qjbpfzfsin", model.family()); - Assertions.assertEquals("v", model.size()); - Assertions.assertEquals(1595507269, model.capacity()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilityWithResponseMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index fc914d739f41..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,38 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; -import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"ipietgbe\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailabilityResponse response = manager.services() - .checkNameAvailabilityWithResponse("hiqakydiwfbrk", - new NameAvailabilityRequest().withName("zdq").withType("hcspo"), com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusWithResponseMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusWithResponseMockTests.java deleted file mode 100644 index a1faa06c114d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesCheckStatusWithResponseMockTests.java +++ /dev/null @@ -1,41 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.DataMigrationServiceStatusResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesCheckStatusWithResponseMockTests { - @Test - public void testCheckStatusWithResponse() throws Exception { - String responseStr - = "{\"agentVersion\":\"lgsc\",\"status\":\"ri\",\"vmSize\":\"rsrrmoucsofldp\",\"supportedTaskTypes\":[\"yfcaabeolhbhlvbm\"]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DataMigrationServiceStatusResponse response - = manager.services().checkStatusWithResponse("hnl", "qnbldxe", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("lgsc", response.agentVersion()); - Assertions.assertEquals("ri", response.status()); - Assertions.assertEquals("rsrrmoucsofldp", response.vmSize()); - Assertions.assertEquals("yfcaabeolhbhlvbm", response.supportedTaskTypes().get(0)); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteMockTests.java deleted file mode 100644 index b62866dcecc3..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesDeleteMockTests.java +++ /dev/null @@ -1,33 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.services().delete("sjcaacfdmmcpugm", "hqepvufhbzehewh", true, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusMockTests.java deleted file mode 100644 index 7665a418128a..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesListSkusMockTests.java +++ /dev/null @@ -1,48 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.AvailableServiceSku; -import com.azure.resourcemanager.datamigration.models.ServiceScalability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesListSkusMockTests { - @Test - public void testListSkus() throws Exception { - String responseStr - = "{\"value\":[{\"resourceType\":\"bmzgwes\",\"sku\":{\"name\":\"xwefohecbvopwndy\",\"family\":\"eallklmtkhlo\",\"size\":\"x\",\"tier\":\"vbrdfjmzsyzfho\"},\"capacity\":{\"minimum\":1472660607,\"maximum\":704144060,\"default\":2107805309,\"scaleType\":\"automatic\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.services().listSkus("v", "xmycjimryvwgcw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bmzgwes", response.iterator().next().resourceType()); - Assertions.assertEquals("xwefohecbvopwndy", response.iterator().next().sku().name()); - Assertions.assertEquals("eallklmtkhlo", response.iterator().next().sku().family()); - Assertions.assertEquals("x", response.iterator().next().sku().size()); - Assertions.assertEquals("vbrdfjmzsyzfho", response.iterator().next().sku().tier()); - Assertions.assertEquals(1472660607, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(704144060, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(2107805309, response.iterator().next().capacity().defaultProperty()); - Assertions.assertEquals(ServiceScalability.AUTOMATIC, response.iterator().next().capacity().scaleType()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilityWithResponseMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 080bf377b5ad..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesNestedCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; -import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesNestedCheckNameAvailabilityWithResponseMockTests { - @Test - public void testNestedCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"ut\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailabilityResponse response = manager.services() - .nestedCheckNameAvailabilityWithResponse("unsjlpjrtwszhvvu", "c", - new NameAvailabilityRequest().withName("vtrrmhwrbfdpyflu").withType("vjglrocuyzlwhhme"), - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStartMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStartMockTests.java deleted file mode 100644 index 18601550ec62..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStartMockTests.java +++ /dev/null @@ -1,33 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesStartMockTests { - @Test - public void testStart() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.services().start("uqibsxtkcu", "fbsfarfsiow", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStopMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStopMockTests.java deleted file mode 100644 index 46ec6753d657..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ServicesStopMockTests.java +++ /dev/null @@ -1,33 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ServicesStopMockTests { - @Test - public void testStop() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.services().stop("kjxnqpvwgfstmhq", "kizmdksaoafclu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SyncMigrationDatabaseErrorEventTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SyncMigrationDatabaseErrorEventTests.java deleted file mode 100644 index 59ecd2370ad4..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/SyncMigrationDatabaseErrorEventTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.SyncMigrationDatabaseErrorEvent; - -public final class SyncMigrationDatabaseErrorEventTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SyncMigrationDatabaseErrorEvent model = BinaryData.fromString( - "{\"timestampString\":\"jhkycub\",\"eventTypeString\":\"dgssofwqmzqal\",\"eventText\":\"mnjijpxacqqudf\"}") - .toObject(SyncMigrationDatabaseErrorEvent.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SyncMigrationDatabaseErrorEvent model = new SyncMigrationDatabaseErrorEvent(); - model = BinaryData.fromObject(model).toObject(SyncMigrationDatabaseErrorEvent.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteWithResponseMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteWithResponseMockTests.java deleted file mode 100644 index 9826a4623934..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/TasksDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TasksDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.tasks() - .deleteWithResponse("tikyj", "zkdbqzolx", "zvhqjwtrhtgvg", "pcrrk", true, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/UsagesListMockTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/UsagesListMockTests.java deleted file mode 100644 index 386a4618f856..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/UsagesListMockTests.java +++ /dev/null @@ -1,43 +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.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.datamigration.DataMigrationManager; -import com.azure.resourcemanager.datamigration.models.Quota; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"currentValue\":74.08255016179143,\"id\":\"ljqobbpihehcecyb\",\"limit\":17.642722568267054,\"name\":{\"localizedValue\":\"bbmpxdlvykfre\",\"value\":\"rseqwjksghudgz\"},\"unit\":\"ogjggsvoujkxibda\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DataMigrationManager manager = DataMigrationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.usages().list("rleaes", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(74.08255016179143D, response.iterator().next().currentValue()); - Assertions.assertEquals("ljqobbpihehcecyb", response.iterator().next().id()); - Assertions.assertEquals(17.642722568267054D, response.iterator().next().limit()); - Assertions.assertEquals("bbmpxdlvykfre", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("rseqwjksghudgz", response.iterator().next().name().value()); - Assertions.assertEquals("ogjggsvoujkxibda", response.iterator().next().unit()); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateMigrationInputSqlServerSqlMISyncTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateMigrationInputSqlServerSqlMISyncTaskOutputTests.java deleted file mode 100644 index 5c2bcb31b928..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateMigrationInputSqlServerSqlMISyncTaskOutputTests.java +++ /dev/null @@ -1,24 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskOutput; - -public final class ValidateMigrationInputSqlServerSqlMISyncTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateMigrationInputSqlServerSqlMISyncTaskOutput model = BinaryData.fromString( - "{\"id\":\"op\",\"name\":\"c\",\"validationErrors\":[{\"message\":\"buhhlkyqlt\",\"actionableMessage\":\"rogtuwkf\",\"filePath\":\"jk\",\"lineNumber\":\"ysidfvclgl\",\"hResult\":17564719,\"stackTrace\":\"ijtk\"},{\"message\":\"sqo\",\"actionableMessage\":\"fikayiansharujtj\",\"filePath\":\"xfz\",\"lineNumber\":\"qttv\",\"hResult\":1782066464,\"stackTrace\":\"hjpenuygbq\"},{\"message\":\"qekewvnqvcd\",\"actionableMessage\":\"uaucmf\",\"filePath\":\"wnlaxpu\",\"lineNumber\":\"qikczvvita\",\"hResult\":830964876,\"stackTrace\":\"fcsserxhtvsox\"},{\"message\":\"wntsjgqrsxy\",\"actionableMessage\":\"uuuybnchrsziz\",\"filePath\":\"uelyetndn\",\"lineNumber\":\"qyggagfl\",\"hResult\":472068918,\"stackTrace\":\"trwahzj\"}]}") - .toObject(ValidateMigrationInputSqlServerSqlMISyncTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateMigrationInputSqlServerSqlMISyncTaskOutput model - = new ValidateMigrationInputSqlServerSqlMISyncTaskOutput(); - model = BinaryData.fromObject(model).toObject(ValidateMigrationInputSqlServerSqlMISyncTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateSyncMigrationInputSqlServerTaskOutputTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateSyncMigrationInputSqlServerTaskOutputTests.java deleted file mode 100644 index e9ffc3e668b3..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidateSyncMigrationInputSqlServerTaskOutputTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ValidateSyncMigrationInputSqlServerTaskOutput; - -public final class ValidateSyncMigrationInputSqlServerTaskOutputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidateSyncMigrationInputSqlServerTaskOutput model = BinaryData.fromString( - "{\"id\":\"swvxwlmzqwmv\",\"name\":\"njmxmcuqudtcvcl\",\"validationErrors\":[{\"message\":\"dkvgfabuiyjibuzp\",\"actionableMessage\":\"ugneikn\",\"filePath\":\"oxgjiuqhibt\",\"lineNumber\":\"ipq\",\"hResult\":399178723,\"stackTrace\":\"mur\"},{\"message\":\"x\",\"actionableMessage\":\"wpktvqylkmqpzoyh\",\"filePath\":\"bcg\",\"lineNumber\":\"cloxo\",\"hResult\":477398510,\"stackTrace\":\"njipnwjfujql\"}]}") - .toObject(ValidateSyncMigrationInputSqlServerTaskOutput.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidateSyncMigrationInputSqlServerTaskOutput model = new ValidateSyncMigrationInputSqlServerTaskOutput(); - model = BinaryData.fromObject(model).toObject(ValidateSyncMigrationInputSqlServerTaskOutput.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidationErrorTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidationErrorTests.java deleted file mode 100644 index 7340b0dbf828..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/ValidationErrorTests.java +++ /dev/null @@ -1,22 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.ValidationError; - -public final class ValidationErrorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ValidationError model - = BinaryData.fromString("{\"text\":\"of\",\"severity\":\"Warning\"}").toObject(ValidationError.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ValidationError model = new ValidationError(); - model = BinaryData.fromObject(model).toObject(ValidationError.class); - } -} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/WaitStatisticsTests.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/WaitStatisticsTests.java deleted file mode 100644 index 21742ec2781d..000000000000 --- a/sdk/datamigration/azure-resourcemanager-datamigration/src/test/java/com/azure/resourcemanager/datamigration/generated/WaitStatisticsTests.java +++ /dev/null @@ -1,23 +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.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.datamigration.models.WaitStatistics; - -public final class WaitStatisticsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WaitStatistics model = BinaryData - .fromString("{\"waitType\":\"wsdtutnwl\",\"waitTimeMs\":91.60054,\"waitCount\":6613508255547335147}") - .toObject(WaitStatistics.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WaitStatistics model = new WaitStatistics(); - model = BinaryData.fromObject(model).toObject(WaitStatistics.class); - } -}